ggozad/mnemonic.js

create a method Mnemonic.fromHexToWords(hex_arg)

Closed this issue · 2 comments

create a method Mnemonic.fromHexToWords(hex_arg)

here a small patch

 var seed ="myhexseed" ;
      var random = [];
      for(var i=0;i<seed.length;i++){
        var integer = parseInt(seed.slice(8*i,i*8+8),16);
        if (!isNaN(integer) ){
          random.push(integer);
        }
      }
      var m  = new Mnemonic();
      m.random = random;
      m.toWord()

Why not make it a pull request and add a test? I mean since you did the effort...