]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Update jsbip39.js to latest version
authorIan Coleman <ian@iancoleman.io>
Mon, 12 Mar 2018 00:06:52 +0000 (11:06 +1100)
committerIan Coleman <ian@iancoleman.io>
Mon, 12 Mar 2018 00:31:41 +0000 (11:31 +1100)
src/js/jsbip39.js
src/js/unorm.js

index 025f6258d7d8462427c993b84d94aed9d1483f0c..95a2a0eb1f2fcc775d340db4ebec954d35faa914 100644 (file)
@@ -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) {
index 92d36993d4d7aebad080a87895e248c489416396..d4292f39aff2149663357e3c7cdee56121499a2b 100644 (file)
@@ -1,3 +1,6 @@
+// Polyfill for NFKD normalization
+// See https://github.com/walling/unorm
+
 (function (root) {
    "use strict";