Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vmizg/rfc1751.js
JavaScript RFC1751 string encoder
https://github.com/vmizg/rfc1751.js
javascript nodejs rfc1751 typescript
Last synced: 18 days ago
JSON representation
JavaScript RFC1751 string encoder
- Host: GitHub
- URL: https://github.com/vmizg/rfc1751.js
- Owner: vmizg
- License: mit
- Created: 2020-01-30T08:53:03.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-07-18T21:55:07.000Z (over 1 year ago)
- Last Synced: 2024-10-16T19:15:17.272Z (29 days ago)
- Topics: javascript, nodejs, rfc1751, typescript
- Language: TypeScript
- Homepage:
- Size: 480 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RFC1751.js
[![npm](https://img.shields.io/npm/v/rfc1751.js?style=flat-square)](https://www.npmjs.com/package/rfc1751.js)
[![npm bundle size](https://img.shields.io/bundlephobia/min/rfc1751.js?style=flat-square)](https://www.npmjs.com/package/rfc1751.js)
[![npm](https://img.shields.io/npm/dw/rfc1751.js?style=flat-square)](https://www.npmjs.com/package/rfc1751.js)An implementation of RFC1751 convention in TypeScript / JavaScript.
Converts between 128-bit strings and a human-readable
sequence of words, as defined in RFC1751: "A Convention for
Human-Readable 128-bit Keys", by Daniel L. McDonald:
https://tools.ietf.org/html/rfc1751## Source implementation
rfc1751.js @ ms-brainwallet.github.io (public domain)
(https://github.com/ms-brainwallet/ms-brainwallet.github.io/blob/master/js/rfc1751.js)rfc1751.py @ Python Cryptography Toolkit, written by Andrew M. Kuchling and others (public domain)
(https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/Util/RFC1751.py)## Installation
```
npm install rfc1751.js
```## Usage
``` javascript
import { btoe, etob } from 'rfc1751.js';let bytearray = new Uint8Array([4, 8, 15, 16, 23, 42, 0, 0]);
let words = btoe(bytearray);
// "AT TIC NIBS ODD JACK ABE"let decoded = etob(words);
// Uint8Array([4, 8, 15, 16, 23, 42, 0, 0])
```## License
It is licensed under MIT license.