JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 87
  • Score
    100M100P100Q65389F
  • License MIT

a string encrypt & decrypt package based on TEA

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

  1. get it

    git clone git@github.com:fiefdx/node-tea.git
    
    or
    
    npm install node-tea
    
  2. 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);
    }