@creatrix/crypto-rn
v0.1.2
Published
Javacript encrypt and decrypt using crypto js
Downloads
2
Maintainers
Readme
Crypto
Encrypt and decrypt object or array date with password
example
yarn add @creatrix/crypto
npm i @creatrix/crypto
import {EncryptData,DecryptData} from @creatrix/crypto;
const encrypteddata=EncryptData(
{id:'1',value:'2'},
MYPASSWORD,
base64(true || false),
isSSR (true || false) // isSSR=false use window.atob(value) || isSSR=true use Buffer.from(value, 'base64').toString('ascii')
) //return encryption data
DecryptData(
encrypteddata,
MYPASSWORD,
base64 (from bae64 true or false),
isSSR (true | false) // isSSR=false use window.btoa(value) || isSSR=true use Buffer.from(value, 'ascii').toString('base64')
) //{id:'1',value:'2'}
import {base64Decode,base64Encode} from @creatrix/crypto;
const var_encode=base64Encode(string,isSSR=(true || false));// isSSR=false use window.btoa(value) || isSSR=true use Buffer.from(value, 'ascii').toString('base64')
const var_decode=base64Decode(string,isSSR=(true || false)); // isSSR=false use window.atob(value) || isSSR=true use Buffer.from(value, 'base64').toString('ascii')