Socket
Socket
Sign inDemoInstall

encode-as-words

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    encode-as-words

Encode bytes as a human readable string of english words


Version published
Weekly downloads
3
Maintainers
1
Install size
221 kB
Created
Weekly downloads
 

Readme

Source

Encode as words

Encode raw binary data as a collection of human readable words, for easy communication.

e.g. 100101111111100111000100001001111110011100010 => peach den vanity chelsea

Example use case, displaying a users public IP for them to read out over the phone during support calls 142.150.42.3 -> liberals tesco cv

Installation

npm install encode-as-words

or

yarn add encode-as-words

Usage

This package supports both browser environments & node js.

import {encodeBytesAsWords, decodeBytesFromWords} from "encode-as-words";

const ipBytes = new Uint8Array([142, 150, 42, 3]);
const words = encodeBytesAsWords(ipBytes);

console.log(words.join(" ")); // liberals tesco cv

const decodedBytes = decodeBytesFromWords(words, 4);
console.log(decodedBytes); // 142, 150, 42, 3

Security note

This is not a form of encryption. Do not store sensitive data using this package.

Keywords

FAQs

Last updated on 19 Oct 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