From: Ian Coleman Date: Mon, 12 Mar 2018 00:06:52 +0000 (+1100) Subject: Update jsbip39.js to latest version X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git;a=commitdiff_plain;h=0514c20b8178b634dccc5a6c120e60b55053ce30 Update jsbip39.js to latest version --- 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) { // Set space correctly depending on the language // see https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md#japanese var space = " "; - if (language == "japanese") { + if (language == "japanese" || language == "korean") { space = "\u3000"; // ideographic space } return words.join(space); } self.normalizeString = function(str) { - if (typeof str.normalize == "function") { - return str.normalize("NFKD"); - } - else { - // TODO decide how to handle this in the future. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize - return str; - } + return str.normalize("NFKD"); } 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 @@ +// Polyfill for NFKD normalization +// See https://github.com/walling/unorm + (function (root) { "use strict";