Socket
Socket
Sign inDemoInstall

hexie-encode

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hexie-encode

使用自定义字典对字符串进行加解密


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

和谐加解密

使用自定义字典对字符串进行加解密

安装

npm i hexie-encode

用社会主义核心价值观对字符串进行对称加解密

import { encode, decode } from 'hexie-encode';

// 公正公正友善敬业文明友善敬业敬业友善敬业敬业友善诚信民主友善自由富强友善文明诚信友善诚信敬业友善诚信民主友善诚信自由友善敬业敬业友善敬业民主友善和谐富强友善文明诚信友善民主自由文明诚信和谐友善民主公正文明和谐法治友善民主自由富强文明和谐友善文明富强公正民主敬业友善自由平等富强平等法治
encode('Hello, world! 你好世界!');

// Hello, world! 你好世界!
decode('公正公正友善敬业文明友善敬业敬业友善敬业敬业友善诚信民主友善自由富强友善文明诚信友善诚信敬业友善诚信民主友善诚信自由友善敬业敬业友善敬业民主友善和谐富强友善文明诚信友善民主自由文明诚信和谐友善民主公正文明和谐法治友善民主自由富强文明和谐友善文明富强公正民主敬业友善自由平等富强平等法治');

并且可以使用自定义的字典进行加解密

字典的复杂度越高,密文就越短

import { encode, decode } from 'hexie-encode';

const dict = ['😀', '😃', '😄', '😁', '😆', '😅', '😂', '🤣', '☺️', '😊', '😇', '🙂', '🙃', '😉', '😌', '😍', '🥰', '😘', '😗', '😙', '😚', '😋', '😛', '😝', '😜', '🤪', '🤨', '🧐', '🤓', '😎', '🤩', '🥳', '😏', '😒', '😞', '😔'];

// 😄😄😔😄🥳😔😁😁😔😁😁😔😁😂😔😃😊😔😏😔😁😌😔😁😂😔😁😊😔😁😁😔😄🤩😔😒😔😏😔🥰😚😚😔😗😜😙😔🥰🙂😅😔😜😘😒😔😃😗😇😂
encode('Hello, world! 你好世界!', dict);

// Hello, world! 你好世界!
decode('😄😄😔😄🥳😔😁😁😔😁😁😔😁😂😔😃😊😔😏😔😁😌😔😁😂😔😁😊😔😁😁😔😄🤩😔😒😔😏😔🥰😚😚😔😗😜😙😔🥰🙂😅😔😜😘😒😔😃😗😇😂', dict);

Keywords

FAQs

Last updated on 04 Aug 2020

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