Package Exports
- node-tea
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-tea) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-tea
A string encrypt & decrypt package based on TEA
get & use
get it
git clone git@github.com:fiefdx/node-tea.git or npm install node-tea
use it
let tea = require('./tea'); { let input = tea.encodeUtf8('this is a test, 这是一个测试'); let s = tea.encrypt(input, '111111'); console.log(s); let ss = tea.decrypt(s, '111111'); let output = tea.decodeUtf8(ss); console.log(output); } { let input = tea.encodeUtf8('this is a test, 这是一个测试'); let s = tea.encryptBase64(input, '111111'); console.log(s); let ss = tea.decryptBase64(s, '111111'); let output = tea.decodeUtf8(ss); console.log(output); } { let input = tea.strToBytes(tea.encodeUtf8('this is a test, 这是一个测试')); let s = tea.encryptBytes(input, '111111'); console.log(s); let ss = tea.decryptBytes(s, '111111'); let output = tea.decodeUtf8(tea.bytesToStr(ss)); console.log(output); }