diff options
-rw-r--r-- | bip39-standalone.html | 6 | ||||
-rw-r--r-- | src/js/jsbip39.js | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/bip39-standalone.html b/bip39-standalone.html index 41634c2..b062b2e 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html | |||
@@ -22432,14 +22432,14 @@ var Mnemonic = function(language) { | |||
22432 | 22432 | ||
22433 | self.toSeed = function(mnemonic, passphrase) { | 22433 | self.toSeed = function(mnemonic, passphrase) { |
22434 | passphrase = passphrase || ''; | 22434 | passphrase = passphrase || ''; |
22435 | mnemonic = normalizeString(mnemonic) | 22435 | mnemonic = self.normalizeString(mnemonic) |
22436 | passphrase = normalizeString(passphrase) | 22436 | passphrase = self.normalizeString(passphrase) |
22437 | passphrase = "mnemonic" + passphrase; | 22437 | passphrase = "mnemonic" + passphrase; |
22438 | //return PBKDF2(mnemonic, 'mnemonic' + passphrase, iterations=PBKDF2_ROUNDS, macmodule=hmac, digestmodule=hashlib.sha512).read(64) | 22438 | //return PBKDF2(mnemonic, 'mnemonic' + passphrase, iterations=PBKDF2_ROUNDS, macmodule=hmac, digestmodule=hashlib.sha512).read(64) |
22439 | return asmCrypto.PBKDF2_HMAC_SHA512.hex(mnemonic, passphrase, PBKDF2_ROUNDS, 512/8); | 22439 | return asmCrypto.PBKDF2_HMAC_SHA512.hex(mnemonic, passphrase, PBKDF2_ROUNDS, 512/8); |
22440 | } | 22440 | } |
22441 | 22441 | ||
22442 | function normalizeString(str) { | 22442 | self.normalizeString = function(str) { |
22443 | if (typeof str.normalize == "function") { | 22443 | if (typeof str.normalize == "function") { |
22444 | return str.normalize("NFKD"); | 22444 | return str.normalize("NFKD"); |
22445 | } | 22445 | } |
diff --git a/src/js/jsbip39.js b/src/js/jsbip39.js index d0ac3ae..7acf77b 100644 --- a/src/js/jsbip39.js +++ b/src/js/jsbip39.js | |||
@@ -121,14 +121,14 @@ var Mnemonic = function(language) { | |||
121 | 121 | ||
122 | self.toSeed = function(mnemonic, passphrase) { | 122 | self.toSeed = function(mnemonic, passphrase) { |
123 | passphrase = passphrase || ''; | 123 | passphrase = passphrase || ''; |
124 | mnemonic = normalizeString(mnemonic) | 124 | mnemonic = self.normalizeString(mnemonic) |
125 | passphrase = normalizeString(passphrase) | 125 | passphrase = self.normalizeString(passphrase) |
126 | passphrase = "mnemonic" + passphrase; | 126 | passphrase = "mnemonic" + passphrase; |
127 | //return PBKDF2(mnemonic, 'mnemonic' + passphrase, iterations=PBKDF2_ROUNDS, macmodule=hmac, digestmodule=hashlib.sha512).read(64) | 127 | //return PBKDF2(mnemonic, 'mnemonic' + passphrase, iterations=PBKDF2_ROUNDS, macmodule=hmac, digestmodule=hashlib.sha512).read(64) |
128 | return asmCrypto.PBKDF2_HMAC_SHA512.hex(mnemonic, passphrase, PBKDF2_ROUNDS, 512/8); | 128 | return asmCrypto.PBKDF2_HMAC_SHA512.hex(mnemonic, passphrase, PBKDF2_ROUNDS, 512/8); |
129 | } | 129 | } |
130 | 130 | ||
131 | function normalizeString(str) { | 131 | self.normalizeString = function(str) { |
132 | if (typeof str.normalize == "function") { | 132 | if (typeof str.normalize == "function") { |
133 | return str.normalize("NFKD"); | 133 | return str.normalize("NFKD"); |
134 | } | 134 | } |