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

Cannot call generatePrime()

Open elliotsayes opened this issue 3 years ago • 0 comments

When calling crypto.generatePrime: TypeError: _reactNativeQuickCrypto.default.generatePrime is not a function.

However, IDE hint indicate the function exists. lib/typescript/index.d.ts:

declare const crypto: {
    ...
    generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
    generatePrime(size: number, options: FallbackCrypto.GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void;
    generatePrime(size: number, options: FallbackCrypto.GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
    generatePrime(size: number, options: FallbackCrypto.GeneratePrimeOptions, callback: (err: Error | null, prime: bigint | ArrayBuffer) => void): void;
    ...
};

Other functions like crypto.getRandomValues work without issue.

elliotsayes avatar Aug 24 '22 08:08 elliotsayes