diff options
author | Ian Coleman <ian@iancoleman.io> | 2018-03-12 11:06:52 +1100 |
---|---|---|
committer | Ian Coleman <ian@iancoleman.io> | 2018-03-12 11:31:41 +1100 |
commit | 0514c20b8178b634dccc5a6c120e60b55053ce30 (patch) | |
tree | 95a94d1e77e4e9d4b935b520f6467af4d98a7f43 | |
parent | f8ca25c3381d5071426497eb3bf34ff5cdf094ee (diff) | |
download | BIP39-0514c20b8178b634dccc5a6c120e60b55053ce30.tar.gz BIP39-0514c20b8178b634dccc5a6c120e60b55053ce30.tar.zst BIP39-0514c20b8178b634dccc5a6c120e60b55053ce30.zip |
Update jsbip39.js to latest version
-rw-r--r-- | src/js/jsbip39.js | 11 | ||||
-rw-r--r-- | src/js/unorm.js | 3 |
2 files changed, 5 insertions, 9 deletions
diff --git a/src/js/jsbip39.js b/src/js/jsbip39.js index 025f625..95a2a0e 100644 --- a/src/js/jsbip39.js +++ b/src/js/jsbip39.js | |||
@@ -149,21 +149,14 @@ var Mnemonic = function(language) { | |||
149 | // Set space correctly depending on the language | 149 | // Set space correctly depending on the language |
150 | // see https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md#japanese | 150 | // see https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md#japanese |
151 | var space = " "; | 151 | var space = " "; |
152 | if (language == "japanese") { | 152 | if (language == "japanese" || language == "korean") { |
153 | space = "\u3000"; // ideographic space | 153 | space = "\u3000"; // ideographic space |
154 | } | 154 | } |
155 | return words.join(space); | 155 | return words.join(space); |
156 | } | 156 | } |
157 | 157 | ||
158 | self.normalizeString = function(str) { | 158 | self.normalizeString = function(str) { |
159 | if (typeof str.normalize == "function") { | 159 | return str.normalize("NFKD"); |
160 | return str.normalize("NFKD"); | ||
161 | } | ||
162 | else { | ||
163 | // TODO decide how to handle this in the future. | ||
164 | // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize | ||
165 | return str; | ||
166 | } | ||
167 | } | 160 | } |
168 | 161 | ||
169 | function byteArrayToWordArray(data) { | 162 | function byteArrayToWordArray(data) { |
diff --git a/src/js/unorm.js b/src/js/unorm.js index 92d3699..d4292f3 100644 --- a/src/js/unorm.js +++ b/src/js/unorm.js | |||
@@ -1,3 +1,6 @@ | |||
1 | // Polyfill for NFKD normalization | ||
2 | // See https://github.com/walling/unorm | ||
3 | |||
1 | (function (root) { | 4 | (function (root) { |
2 | "use strict"; | 5 | "use strict"; |
3 | 6 | ||