Skip to content

Commit

Permalink
fix: noble-ciphers dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Curtish <ch@curtish.me>
  • Loading branch information
curtis-h committed Sep 3, 2024
1 parent 2c7336a commit cff4800
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 41 deletions.
48 changes: 14 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
},
"dependencies": {
"@hyperledger/identus-apollo": "^1.4.3",
"@noble/ciphers": "^0.6.0",
"@scure/bip32": "^1.3.0",
"@scure/bip39": "^1.1.1",
"@sd-jwt/sd-jwt-vc": "^0.7.1",
Expand Down Expand Up @@ -228,4 +229,4 @@
"overrides": {
"ws": "^8.17.1"
}
}
}
12 changes: 6 additions & 6 deletions src/domain/utils/randomBytes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { crypto } from '@noble/ciphers/webcrypto/crypto';
import { crypto } from '@noble/ciphers/crypto';

export function randomBytes(bytes: Uint8Array): Uint8Array {
if (crypto && typeof crypto.getRandomValues === 'function') {
return crypto.getRandomValues(bytes);
}
throw new Error('crypto.getRandomValues must be defined');
}
if (crypto && typeof crypto.getRandomValues === 'function') {
return crypto.getRandomValues(bytes);
}
throw new Error('crypto.getRandomValues must be defined');
}

0 comments on commit cff4800

Please sign in to comment.