rc4-ts
v2.0.0
Published
rc4 es6
Downloads
47
Readme
RC4 JS
Usage
npm i rc4-es6 || yarn add rc4-es6
import RC4Class from 'rc4-es6';
const encryptKey = '123456';
const rc4 = new RC4Class(encryptKey);
const needEncryptData = 'abcde';
const base64Data = window.btoa(window.unescape(window.encodeURIComponent(needEncryptData)));
const encryptResult = rc4.encrypt(base64Data);
const decryptResult = rc4.decrypt(encryptResult);
const finalResult = window.decodeURIComponent(window.escape(window.atob(decryptResult)));
For what
- Encrypt http req entity
- localStorage user infomation