aboutsummaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2014-09-27 21:50:48 +1000
committerIan Coleman <coleman.ian@gmail.com>2014-09-27 21:50:48 +1000
commitbe6ba9a836bebfb245c0d139436e728296485e5e (patch)
treec19dfae080b2d0393ca62ca03898115255b7b035 /src/js
parent3f45abbf926973fa2f37ebba8e58ba2d9c25c8c8 (diff)
downloadBIP39-be6ba9a836bebfb245c0d139436e728296485e5e.tar.gz
BIP39-be6ba9a836bebfb245c0d139436e728296485e5e.tar.zst
BIP39-be6ba9a836bebfb245c0d139436e728296485e5e.zip
mnemonic.normalizeString method made public
Diffstat (limited to 'src/js')
-rw-r--r--src/js/jsbip39.js6
1 files changed, 3 insertions, 3 deletions
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 }