Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/mbrubeck/mnemonic.js

Mnemonic encoding of binary data, based on Oren Tirosh's mnemonic.c
https://github.com/mbrubeck/mnemonic.js

Last synced: about 2 months ago
JSON representation

Mnemonic encoding of binary data, based on Oren Tirosh's mnemonic.c

Awesome Lists containing this project

README

        

This is a direct JavaScript port of the mnemonic encoder originally written
in C by Oren Tirosh and available from:

https://github.com/singpolyma/mnemonicode

These routines implement a method for encoding binary data into a sequence
of words which can be spoken over the phone, for example, and converted
back to data on the other side.

For more information, see:

http://web.archive.org/web/20101031205747/http://www.tothink.com/mnemonic/

Example usage:

>>> mnemonic.encode([101, 2, 240, 6, 108, 11, 20, 97])
"digital-apollo-aroma--rival-artist-rebel"

>>> mnemonic.encode([101, 2, 240, 6, 108, 11, 20, 97], "x/x/x - ")
"digital/apollo/aroma - rival/artist/rebel"

>>> mnemonic.decode("digital.apollo.aroma.rival.artist.rebel")
[101, 2, 240, 6, 108, 11, 20, 97]

>>> mnemonic.encode_int32(438871)
"judo-fluid-jet"

>>> mnemonic.decode_int32("judo-fluid-jet")
438871

Available under the MIT license.