Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.