@creatrix/crypto
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

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')

Package Sidebar

Install

npm i @creatrix/crypto

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

32.3 kB

Total Files

24

Last publish

Collaborators

  • creatrixlb