]> zoso.dev Git - libnemo.git/commitdiff
Version 1.4.3
authorMiro Metsänheimo <miro@metsanheimo.fi>
Wed, 27 Apr 2022 19:13:08 +0000 (22:13 +0300)
committerMiro Metsänheimo <miro@metsanheimo.fi>
Wed, 27 Apr 2022 19:13:08 +0000 (22:13 +0300)
* Revert back a change regarding entropy length

README.md
lib/bip39-mnemonic.ts
package-lock.json
package.json

index f2a84033a4d8355290fced5af44876c357aa2178..ede22d862220ba9b7f8a2791bf3988dd41c6c6dc 100644 (file)
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ npm install nanocurrency-web
 ### In web
 
 ```html
-<script src="https://unpkg.com/nanocurrency-web@1.4.2" type="text/javascript"></script>
+<script src="https://unpkg.com/nanocurrency-web@1.4.3" type="text/javascript"></script>
 <script type="text/javascript">
     NanocurrencyWeb.wallet.generate(...);
 </script>
index 0ec34dca275c71d7d98fa749f02ef6248110a88e..7539247178d4ef32203645b4e203dc014874c16e 100644 (file)
@@ -16,7 +16,7 @@ export default class Bip39Mnemonic {
        static createWallet = (entropy: string, password: string): MnemonicSeed => {
                if (entropy) {
                        if (entropy.length !== 64) {
-                               throw new Error('Invalid entropy length, must be a 64 byte hexadecimal string')
+                               throw new Error('Invalid entropy length, must be a 32 bit hexadecimal string')
                        }
                        if (!/^[0-9a-fA-F]+$/i.test(entropy)) {
                                throw new Error('Entopy is not a valid hexadecimal string')
@@ -24,7 +24,7 @@ export default class Bip39Mnemonic {
                }
 
                if (!entropy) {
-                       entropy = this.randomHex(64)
+                       entropy = this.randomHex(32)
                }
 
                const mnemonic = this.deriveMnemonic(entropy)
@@ -45,7 +45,7 @@ export default class Bip39Mnemonic {
        static createLegacyWallet = (seed?: string): MnemonicSeed => {
                if (seed) {
                        if (seed.length !== 64) {
-                               throw new Error('Invalid entropy length, must be a 64 byte hexadecimal string')
+                               throw new Error('Invalid entropy length, must be a 32 bit hexadecimal string')
                        }
                        if (!/^[0-9a-fA-F]+$/i.test(seed)) {
                                throw new Error('Entopy is not a valid hexadecimal string')
index b4cb72f4d920b6b3ca4cf419b87123400351cc11..f402b4ba3c150566ef39bd8d7354afcc9a41d1af 100644 (file)
@@ -1,6 +1,6 @@
 {
        "name": "nanocurrency-web",
-       "version": "1.4.2",
+       "version": "1.4.3",
        "lockfileVersion": 1,
        "requires": true,
        "dependencies": {
index 0d2c630da198529c36ae0b2fbd7619d6d9d124d1..cfdc2d71ebfb3a904e82f49d693599e5d1cd54c4 100644 (file)
@@ -1,6 +1,6 @@
 {
        "name": "nanocurrency-web",
-       "version": "1.4.2",
+       "version": "1.4.3",
        "description": "Toolkit for Nano cryptocurrency client side offline integrations",
        "author": "Miro Metsänheimo <miro@metsanheimo.fi>",
        "license": "MIT",