Socket
Socket
Sign inDemoInstall

node-tea

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-tea

a string encrypt & decrypt package based on TEA


Version published
Weekly downloads
194
decreased by-33.33%
Maintainers
1
Install size
71.2 kB
Created
Weekly downloads
 

Readme

Source

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);
    }
    

Keywords

FAQs

Last updated on 27 Sep 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc