Coder Social home page Coder Social logo

drhus / pgp-word-list-converter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from warrenguy/javascript-pgp-word-list

1.0 2.0 0.0 9 KB

Convert hex strings to PGP word lists and vice-versa.

Home Page: https://drhus.github.io/pgp-word-list-converter/.

License: MIT License

JavaScript 84.94% HTML 15.06%

pgp-word-list-converter's Introduction

pgp-word-list.js

Convert hex strings to PGP word lists and vice-versa.

See PGP word list on WikiPedia for more information.

Usage

Include pgp-word-list.js, which provides following functions:

> pgp_words_to_hex(["stairway", "souvenir", "flytrap", "recipe"])
=> ["D1", "D4", "64", "C0"]

> pgp_hex_to_words(["D1", "D4", "64", "C0"])
=> ["stairway", "souvenir", "flytrap", "recipe"]

also singular pgp_word_to_hex(word) and pgp_hex_to_word(hex, position).

More examples

> var hexstring = 'd1d4 64c0';
> pgp_hex_to_words(hexstring.toUpperCase().replace(/[^0-9A-F]/g,'').match(/.{1,2}/g))
=> ["stairway", "souvenir", "flytrap", "recipe"]

> var wordstring = 'stairway souvenir flytrap recipe';
> pgp_words_to_hex(wordstring.split(' '))
=> ["D1", "D4", "64", "C0"]

> pgp_words_to_hex(wordstring.split(' ')).join(' ')
=> "D1 D4 64 C0"

etc...

pgp-word-list-converter's People

Contributors

warrenguy avatar drhus avatar

Stargazers

Armand Declercq avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.