You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting the following error while trying to run the readme example:
[TypeError: _reactNativeAesCrypto.default.pbkdf2 is not a function. (In '_reactNativeAesCrypto.default.pbkdf2(password, salt, cost, length)', '_reactNativeAesCrypto.default.pbkdf2' is undefined)]
Environment
"react-native": "0.64.2"
"react": "17.0.1"
Below is my entire file
import React from 'react';
import {Text} from 'react-native';
import Aes from 'react-native-aes-crypto';
I'm getting the following error while trying to run the readme example:
[TypeError: _reactNativeAesCrypto.default.pbkdf2 is not a function. (In '_reactNativeAesCrypto.default.pbkdf2(password, salt, cost, length)', '_reactNativeAesCrypto.default.pbkdf2' is undefined)]
Environment
"react-native": "0.64.2"
"react": "17.0.1"
Below is my entire file
import React from 'react';
import {Text} from 'react-native';
import Aes from 'react-native-aes-crypto';
const generateKey = (password, salt, cost, length) =>
Aes.pbkdf2(password, salt, cost, length);
const encryptData = (text, key) => {
return Aes.randomKey(16).then(iv => {
return Aes.encrypt(text, key, iv).then(cipher => ({
cipher,
iv,
}));
});
};
const decryptData = (encryptedData, key) =>
Aes.decrypt(encryptedData.cipher, key, encryptedData.iv);
try {
generateKey('Arnold', 'salt', 5000, 256).then(key => {
console.log('Key:', key);
encryptData('These violent delights have violent ends', key)
.then(({cipher, iv}) => {
console.log('Encrypted:', cipher);
});
} catch (e) {
console.error(e);
}
const Encrypt = () => {
return Hello;
};
export default Encrypt;
The text was updated successfully, but these errors were encountered: