Skip to content

Commit

Permalink
chore: moved from crypto to @noble/hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
stackchain committed Dec 3, 2024
1 parent a490a60 commit 7ff286f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@jamsinclair/react-native-notifications": "^5.1.1",
"@ledgerhq/react-native-hw-transport-ble": "6.27.3",
"@noble/ciphers": "^1.1.3",
"@noble/hashes": "^1.6.1",
"@react-native-async-storage/async-storage": "2.0.0",
"@react-native-clipboard/clipboard": "^1.15.0",
"@react-native-masked-view/masked-view": "^0.3.2",
Expand Down
6 changes: 3 additions & 3 deletions apps/wallet/src/yoroi-wallets/utils/crypto-random-string.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import crypto from 'crypto'
import {randomBytes} from '@noble/hashes/utils'

export function cryptoRandomString(length: number): string {
return crypto.randomBytes(length).toString('hex')
export function cryptoRandomString(length: number) {
return Buffer.from(randomBytes(length)).toString('hex')
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2947,7 +2947,7 @@
resolved "https://registry.yarnpkg.com/@noble/ciphers/-/ciphers-1.1.3.tgz#eb27085aa7ce94d8c6eaeb64299bab0589920ec1"
integrity sha512-Ygv6WnWJHLLiW4fnNDC1z+i13bud+enXOFRBlpxI+NJliPWx5wdR+oWlTjLuBPTqjUjtHXtjkU6w3kuuH6upZA==

"@noble/hashes@^1.2.0", "@noble/hashes@^1.3.2":
"@noble/hashes@^1.2.0", "@noble/hashes@^1.3.2", "@noble/hashes@^1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.6.1.tgz#df6e5943edcea504bac61395926d6fd67869a0d5"
integrity sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w==
Expand Down

0 comments on commit 7ff286f

Please sign in to comment.