From: iancoleman Date: Sat, 19 Mar 2016 23:22:23 +0000 (+1100) Subject: Merge pull request #18 from kirillkovalenko/master X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=77baafef3f179a66b2703f73b5fc367cb2d517e7;hp=18531979e830c8c094e8de0b3ee593eebd250807;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git Merge pull request #18 from kirillkovalenko/master BIP39 seed --- diff --git a/compile.py b/compile.py index 4d2dbe2..1ab3328 100644 --- a/compile.py +++ b/compile.py @@ -13,7 +13,7 @@ f.close() # Script tags -scriptsFinder = re.compile("""""") +scriptsFinder = re.compile("""""") scripts = scriptsFinder.findall(page) for script in scripts: @@ -21,13 +21,13 @@ for script in scripts: s = open(filename) scriptContent = "" % s.read() s.close() - scriptTag = """""" % script + scriptTag = """""" % script page = page.replace(scriptTag, scriptContent) # Style tags -stylesFinder = re.compile("""""") +stylesFinder = re.compile("""""") styles = stylesFinder.findall(page) for style in styles: @@ -35,7 +35,7 @@ for style in styles: s = open(filename) styleContent = "" % s.read() s.close() - styleTag = """""" % style + styleTag = """""" % style page = page.replace(styleTag, styleContent) diff --git a/src/index.html b/src/index.html index 1699b39..16d93e6 100644 --- a/src/index.html +++ b/src/index.html @@ -3,7 +3,7 @@ BIP39 - Mnemonic Code - + @@ -88,6 +88,12 @@ +
+ +
+ +
+
@@ -385,13 +391,13 @@ - - - - - - - - + + + + + + + + diff --git a/src/js/index.js b/src/js/index.js index 9dabe95..4f1ab24 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -1,6 +1,7 @@ (function() { var mnemonic = new Mnemonic("english"); + var seed = null var bip32RootKey = null; var bip32ExtendedKey = null; var network = bitcoin.networks.bitcoin; @@ -18,6 +19,7 @@ DOM.phrase = $(".phrase"); DOM.passphrase = $(".passphrase"); DOM.generate = $(".generate"); + DOM.seed = $(".seed"); DOM.rootKey = $(".root-key"); DOM.extendedPrivKey = $(".extended-priv-key"); DOM.extendedPubKey = $(".extended-pub-key"); @@ -169,7 +171,7 @@ } function calcBip32Seed(phrase, passphrase, path) { - var seed = mnemonic.toSeed(phrase, passphrase); + seed = mnemonic.toSeed(phrase, passphrase); bip32RootKey = bitcoin.HDNode.fromSeedHex(seed, network); bip32ExtendedKey = bip32RootKey; // Derive the key from the path @@ -232,6 +234,7 @@ function displayBip32Info() { // Display the key + DOM.seed.val(seed); var rootKey = bip32RootKey.toBase58(); DOM.rootKey.val(rootKey); var extendedPrivKey = bip32ExtendedKey.toBase58();