react-native-quick-crypto
react-native-quick-crypto copied to clipboard
`getHashes` give a wrong hash names
Repro:
import crypto from 'react-native-quick-crypto'
const sha3 = crypto.createHash('sha3-256')
console.log('hashes:', crypto.getHashes(),'sha3', sha3.update(new Uint8Array(20)).digest('hex'))
=
Result:
hashes: ["sha1", "sha224", "sha256", "sha384", "sha512", "md5", "rmd160", "sha224WithRSAEncryption", "RSA-SHA224", "sha256WithRSAEncryption", "RSA-SHA256", "sha384WithRSAEncryption", "RSA-SHA384", "sha512WithRSAEncryption", "RSA-SHA512", "RSA-SHA1", "ecdsa-with-SHA1", "sha256", "sha224", "sha384", "sha512", "DSA-SHA", "DSA-SHA1", "DSA", "DSA-WITH-SHA224", "DSA-SHA224", "DSA-WITH-SHA256", "DSA-SHA256", "DSA-WITH-SHA384", "DSA-SHA384", "DSA-WITH-SHA512", "DSA-SHA512", "DSA-RIPEMD160", "ripemd160WithRSA", "RSA-RIPEMD160", "md5WithRSAEncryption", "RSA-MD5"] sha3 f3683c9e3da9a7f90397767215345efe3be07565f14ab80d102f50644b98fbfa
So sha3 executes, but according to getHashes shouln't
Source of problem: getHashes is not overriden from crypto-browserify