Skip to content

Commit bce953b

Browse files
authored
Merge pull request #10 from paulmillr/master
Update to new noble packages
2 parents 813190f + 4182b1d commit bce953b

File tree

14 files changed

+28
-28
lines changed

14 files changed

+28
-28
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
"*.d.ts.map"
4747
],
4848
"dependencies": {
49-
"noble-hashes": "^0.2.1",
5049
"micro-base": "^0.9.0",
51-
"noble-secp256k1": "^1.2.14"
50+
"@noble/hashes": "^0.4.1",
51+
"@noble/secp256k1": "^1.3.0"
5252
},
5353
"browser": {
5454
"crypto": false
@@ -102,4 +102,4 @@
102102
"context": "browser"
103103
}
104104
}
105-
}
105+
}

src/bip39/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { utils as baseUtils } from "micro-base";
2-
import { pbkdf2, pbkdf2Async } from "noble-hashes/lib/pbkdf2";
3-
import { sha256 } from "noble-hashes/lib/sha256";
4-
import { sha512 } from "noble-hashes/lib/sha512";
5-
import { assertNumber } from "noble-hashes/lib/utils";
2+
import { pbkdf2, pbkdf2Async } from "@noble/hashes/lib/pbkdf2";
3+
import { sha256 } from "@noble/hashes/lib/sha256";
4+
import { sha512 } from "@noble/hashes/lib/sha512";
5+
import { assertNumber } from "@noble/hashes/lib/utils";
66
import { getRandomBytesSync } from "../random";
77
import { assertBytes } from "../utils";
88

src/blake2b.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { blake2b as _blake2b } from "noble-hashes/lib/blake2b";
1+
import { blake2b as _blake2b } from "@noble/hashes/lib/blake2b";
22
import { assertBytes } from "./utils";
33

44
export const blake2b = (msg: Uint8Array, outputLength = 64): Uint8Array => {

src/hdkey.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { base58check } from "micro-base";
2-
import { hmac } from "noble-hashes/lib/hmac";
3-
import { ripemd160 } from "noble-hashes/lib/ripemd160";
4-
import { sha256 } from "noble-hashes/lib/sha256";
5-
import { sha512 } from "noble-hashes/lib/sha512";
6-
import { bytesToHex } from "noble-hashes/lib/utils";
2+
import { hmac } from "@noble/hashes/lib/hmac";
3+
import { ripemd160 } from "@noble/hashes/lib/ripemd160";
4+
import { sha256 } from "@noble/hashes/lib/sha256";
5+
import { sha512 } from "@noble/hashes/lib/sha512";
6+
import { bytesToHex } from "@noble/hashes/lib/utils";
77
import * as secp from "./secp256k1";
88
import {
99
assertBytes,

src/keccak.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as sha3 from "noble-hashes/lib/sha3";
1+
import * as sha3 from "@noble/hashes/lib/sha3";
22
import { wrapHash } from "./utils";
33

44
export const keccak224 = wrapHash(sha3.keccak_224);

src/pbkdf2.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {
22
pbkdf2 as _pbkdf2,
33
pbkdf2Async as _pbkdf2Async
4-
} from "noble-hashes/lib/pbkdf2";
5-
import { sha256 } from "noble-hashes/lib/sha256";
6-
import { sha512 } from "noble-hashes/lib/sha512";
4+
} from "@noble/hashes/lib/pbkdf2";
5+
import { sha256 } from "@noble/hashes/lib/sha256";
6+
import { sha512 } from "@noble/hashes/lib/sha512";
77
import { assertBytes } from "./utils";
88

99
export async function pbkdf2(

src/ripemd160.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ripemd160 as _ripemd160 } from "noble-hashes/lib/ripemd160";
1+
import { ripemd160 as _ripemd160 } from "@noble/hashes/lib/ripemd160";
22
import { wrapHash } from "./utils";
33

44
export const ripemd160 = wrapHash(_ripemd160);

src/scrypt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
scrypt as _scrypt,
33
scryptAsync as _scryptAsync
4-
} from "noble-hashes/lib/scrypt";
4+
} from "@noble/hashes/lib/scrypt";
55
import { assertBytes } from "./utils";
66

77
export async function scrypt(

src/secp256k1-compat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sha256 } from "noble-hashes/lib/sha256";
1+
import { sha256 } from "@noble/hashes/lib/sha256";
22
import * as secp from "./secp256k1";
33
import { assertBool, assertBytes, hexToBytes, toHex } from "./utils";
44

src/secp256k1.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { hmac } from "noble-hashes/lib/hmac";
2-
import { sha256 } from "noble-hashes/lib/sha256";
3-
import { utils as _utils } from "noble-secp256k1";
1+
import { hmac } from "@noble/hashes/lib/hmac";
2+
import { sha256 } from "@noble/hashes/lib/sha256";
3+
import { utils as _utils } from "@noble/secp256k1";
44
export {
55
getPublicKey,
66
sign,
@@ -11,7 +11,7 @@ export {
1111
Point,
1212
Signature,
1313
CURVE
14-
} from "noble-secp256k1";
14+
} from "@noble/secp256k1";
1515

1616
// Enable sync API for noble-secp256k1
1717
_utils.hmacSha256Sync = (key: Uint8Array, ...messages: Uint8Array[]) => {

0 commit comments

Comments
 (0)