-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: replaced stablelib with noble libs #216
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM since it's validated by the PR in the monorepo
export function randomBytes(length: number): Uint8Array { | ||
const buf = crypto.randomBytes(length); | ||
return bufferToArray(buf); | ||
return rb(length); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this method anymore
export function fallbackSha256(msg: Uint8Array): Uint8Array { | ||
const result = hash.sha256().update(msg).digest(HEX_ENC); | ||
return hexToArray(result); | ||
return sha256(msg); | ||
} | ||
|
||
export function fallbackSha512(msg: Uint8Array): Uint8Array { | ||
const result = hash.sha512().update(msg).digest(HEX_ENC); | ||
return hexToArray(result); | ||
return sha512(msg); | ||
} | ||
|
||
export function fallbackRipemd160(msg: Uint8Array): Uint8Array { | ||
const result = hash.ripemd160().update(msg).digest(HEX_ENC); | ||
return hexToArray(result); | ||
return ripemd160(msg); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods are no longer needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see the reduction in boilerplate code
@ganchoradkov I suggest to use newly released 1.7.1 and 1.2.1. These will be used in ethereum-cryptoraphy so you will benefit from deduplication |
Based on #185, opened new PR due to conflicts in the initial PR
Replaced
aes-js
->@noble/ciphers
hash.js
->@noble/hashes
@stablelib/x25519
->@noble/curves
@stablelib/ed25519
->@noble/curves
randombytes
->@noble/hashes
Canaries
@walletconnect/[email protected]
@walletconnect/[email protected]
@walletconnect/[email protected]
@walletconnect/[email protected]