@nomicfoundation/hardhat-utils 3.0.0-next.26 → 3.0.0-next.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/dist/src/crypto.d.ts +7 -0
- package/dist/src/crypto.d.ts.map +1 -1
- package/dist/src/crypto.js +10 -0
- package/dist/src/crypto.js.map +1 -1
- package/package.json +2 -2
- package/src/crypto.ts +11 -0
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# hardhat-utils
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> ⚠️ This package is an internal Hardhat component and it's not meant to be used directly.
|
|
4
4
|
|
|
5
5
|
This package contains utilities used by Hardhat 3 and its plugins.
|
|
6
|
-
|
|
7
|
-
This package is internal to Hardhat and should not be used directly.
|
package/dist/src/crypto.d.ts
CHANGED
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
* @returns The Keccak-256 hash of the input bytes.
|
|
6
6
|
*/
|
|
7
7
|
export declare function keccak256(bytes: Uint8Array): Promise<Uint8Array>;
|
|
8
|
+
/**
|
|
9
|
+
* Computes the SHA-256 hash of the input bytes.
|
|
10
|
+
*
|
|
11
|
+
* @param bytes The input bytes to hash.
|
|
12
|
+
* @returns The SHA-256 hash of the input bytes.
|
|
13
|
+
*/
|
|
14
|
+
export declare function sha256(bytes: Uint8Array): Promise<Uint8Array>;
|
|
8
15
|
/**
|
|
9
16
|
* Creates a non-cryptographic hash-based identifier for the given input.
|
|
10
17
|
*
|
package/dist/src/crypto.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAEtE;AAED;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAEnE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
package/dist/src/crypto.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { keccak256 as keccak256Impl } from "ethereum-cryptography/keccak";
|
|
2
|
+
import { sha256 as sha256Impl } from "ethereum-cryptography/sha256";
|
|
2
3
|
/**
|
|
3
4
|
* Computes the Keccak-256 hash of the input bytes.
|
|
4
5
|
*
|
|
@@ -8,6 +9,15 @@ import { keccak256 as keccak256Impl } from "ethereum-cryptography/keccak";
|
|
|
8
9
|
export async function keccak256(bytes) {
|
|
9
10
|
return keccak256Impl(bytes);
|
|
10
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Computes the SHA-256 hash of the input bytes.
|
|
14
|
+
*
|
|
15
|
+
* @param bytes The input bytes to hash.
|
|
16
|
+
* @returns The SHA-256 hash of the input bytes.
|
|
17
|
+
*/
|
|
18
|
+
export async function sha256(bytes) {
|
|
19
|
+
return sha256Impl(bytes);
|
|
20
|
+
}
|
|
11
21
|
/**
|
|
12
22
|
* Creates a non-cryptographic hash-based identifier for the given input.
|
|
13
23
|
*
|
package/dist/src/crypto.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,KAAiB;IAC/C,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,KAAiB;IAC5C,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,IAAY;IAEZ,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomicfoundation/hardhat-utils",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.28",
|
|
4
4
|
"description": "Utilities for Hardhat and its plugins",
|
|
5
5
|
"homepage": "https://github.com/nomicfoundation/hardhat/tree/v-next/v-next/hardhat-utils",
|
|
6
6
|
"repository": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"README.md"
|
|
49
49
|
],
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@nomicfoundation/hardhat-node-test-reporter": "^3.0.0-next.
|
|
51
|
+
"@nomicfoundation/hardhat-node-test-reporter": "^3.0.0-next.28",
|
|
52
52
|
"@types/bn.js": "^5.1.5",
|
|
53
53
|
"@types/debug": "^4.1.7",
|
|
54
54
|
"@types/node": "^20.14.9",
|
package/src/crypto.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { keccak256 as keccak256Impl } from "ethereum-cryptography/keccak";
|
|
2
|
+
import { sha256 as sha256Impl } from "ethereum-cryptography/sha256";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Computes the Keccak-256 hash of the input bytes.
|
|
@@ -10,6 +11,16 @@ export async function keccak256(bytes: Uint8Array): Promise<Uint8Array> {
|
|
|
10
11
|
return keccak256Impl(bytes);
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Computes the SHA-256 hash of the input bytes.
|
|
16
|
+
*
|
|
17
|
+
* @param bytes The input bytes to hash.
|
|
18
|
+
* @returns The SHA-256 hash of the input bytes.
|
|
19
|
+
*/
|
|
20
|
+
export async function sha256(bytes: Uint8Array): Promise<Uint8Array> {
|
|
21
|
+
return sha256Impl(bytes);
|
|
22
|
+
}
|
|
23
|
+
|
|
13
24
|
/**
|
|
14
25
|
* Creates a non-cryptographic hash-based identifier for the given input.
|
|
15
26
|
*
|