react-native-quick-crypto icon indicating copy to clipboard operation
react-native-quick-crypto copied to clipboard

feat: add support for Uint8Array

Open DavideSegullo opened this issue 1 year ago • 0 comments

This PR adds support for keys such as uint8array for the prepareSecretKey method, I noticed while trying to generate a mnemonic with the following code:

import { generateMnemonic as generateBIP39Mnemonic } from '@scure/bip39';
import { wordlist } from '@scure/bip39/wordlists/english';

That due to the checks within prepareSecretKey, keys in the format of Uint8Array were not supported and this generated the following exception:

Invalid argument type for "key". Need ArrayBuffer, KeyObject, CryptoKey, string

DavideSegullo avatar May 16 '24 17:05 DavideSegullo