Open johnmagbag1995 opened 3 years ago
I'm doing some bundle size optimization. My problem is how to import the CryptoJS.mode.CBC without importing the whole library.
`import CryptoJS from 'crypto-js'; import Utf8 from 'crypto-js/enc-utf8'; import { decrypt, encrypt } from 'crypto-js/aes';
const cipher = decrypt(encryptString, Utf8.parse(key), { iv: Utf8.parse(iv), mode: CryptoJS.mode.CBC, });`
Maybe you could try CryptoES,
It has same code with CryptoJS inside. It supports partially importing.
I'm doing some bundle size optimization. My problem is how to import the CryptoJS.mode.CBC without importing the whole library.
`import CryptoJS from 'crypto-js'; import Utf8 from 'crypto-js/enc-utf8'; import { decrypt, encrypt } from 'crypto-js/aes';
const cipher = decrypt(encryptString, Utf8.parse(key), { iv: Utf8.parse(iv), mode: CryptoJS.mode.CBC, });`