@digitaldefiance/ecies-lib 4.4.8 → 4.4.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitaldefiance/ecies-lib",
3
- "version": "4.4.8",
3
+ "version": "4.4.11",
4
4
  "description": "Digital Defiance ECIES Library",
5
5
  "homepage": "https://github.com/Digital-Defiance/ecies-lib",
6
6
  "repository": {
@@ -54,7 +54,7 @@
54
54
  "license": "MIT",
55
55
  "packageManager": "yarn@4.11.0",
56
56
  "dependencies": {
57
- "@digitaldefiance/i18n-lib": "3.8.3",
57
+ "@digitaldefiance/i18n-lib": "3.8.5",
58
58
  "@ethereumjs/wallet": "^10.0.0",
59
59
  "@noble/curves": "^2.0.1",
60
60
  "@noble/hashes": "^2.0.1",
@@ -1,4 +1,5 @@
1
- import { createHash } from 'crypto';
1
+ import { sha256 } from '@noble/hashes/sha2.js';
2
+ import { bytesToHex } from '@noble/hashes/utils.js';
2
3
  import type { IConstants } from '../interfaces/constants';
3
4
 
4
5
  /**
@@ -10,7 +11,9 @@ export function calculateConfigChecksum(config: IConstants): string {
10
11
  const replacer = (_key: string, value: any) =>
11
12
  typeof value === 'bigint' ? value.toString() : value;
12
13
  const stable = JSON.stringify(config, replacer);
13
- return createHash('sha256').update(stable).digest('hex');
14
+ const encoder = new TextEncoder();
15
+ const data = encoder.encode(stable);
16
+ return bytesToHex(sha256(data));
14
17
  }
15
18
 
16
19
  /**