From: Miro Metsänheimo Date: Wed, 27 Apr 2022 19:13:08 +0000 (+0300) Subject: Version 1.4.3 X-Git-Tag: v0.0.1~12 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=8ceb7d7ee544596a03261b2fc3ec0340343ec96a;p=libnemo.git Version 1.4.3 * Revert back a change regarding entropy length --- diff --git a/README.md b/README.md index f2a8403..ede22d8 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ npm install nanocurrency-web ### In web ```html - + diff --git a/lib/bip39-mnemonic.ts b/lib/bip39-mnemonic.ts index 0ec34dc..7539247 100644 --- a/lib/bip39-mnemonic.ts +++ b/lib/bip39-mnemonic.ts @@ -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') diff --git a/package-lock.json b/package-lock.json index b4cb72f..f402b4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nanocurrency-web", - "version": "1.4.2", + "version": "1.4.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0d2c630..cfdc2d7 100644 --- a/package.json +++ b/package.json @@ -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 ", "license": "MIT",