Giter Site home page Giter Site logo

staltz / ssb-keys-mnemonic Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 5.0 15 KB

Module that converts from/to SSB keys and BIP39 mnemonic codes

License: MIT License

TypeScript 28.17% JavaScript 71.83%
ssb ssb-server bip39 bip39-mnemonic-codes mnemonic

ssb-keys-mnemonic's Introduction

ssb-keys-mnemonic

Module that converts from/to SSB keys and BIP39 mnemonic codes.

npm install --save ssb-keys-mnemonic

Usage

keysToWords(keys: object): string

const mnemonic = require('ssb-keys-mnemonic')

const keys = {
  curve: 'ed25519',
  public: '1nf1T1tUSa43dWglCHzyKIxV61jG/EeeL1Xq1Nk8I3U=.ed25519',
  private: 'GO0Lv5BvcuuJJdHrokHoo0PmCDC/XjO/SZ6H+ddq4UvWd/VPW1RJrjd1aCUIfPIojFXrWMb8R54vVerU2TwjdQ==.ed25519',
  id: '@1nf1T1tUSa43dWglCHzyKIxV61jG/EeeL1Xq1Nk8I3U=.ed25519'
}

const words = mnemonic.keysToWords(keys)

console.log(words)
/*

'body hair useful camp warm into cause riot two bamboo kick educate dinosaur advice seed type crisp where guilt avocado output rely lunch goddess'

*/

wordsToKeys(words: string): object

const mnemonic = require('ssb-keys-mnemonic')

const words = 'body hair useful camp warm into cause riot two bamboo kick educate dinosaur advice seed type crisp where guilt avocado output rely lunch goddess'

const keys = mnemonic.wordsToKeys(words)

console.log(keys)
/*

{ curve: 'ed25519',
  public: '1nf1T1tUSa43dWglCHzyKIxV61jG/EeeL1Xq1Nk8I3U=.ed25519',
  private: 'GO0Lv5BvcuuJJdHrokHoo0PmCDC/XjO/SZ6H+ddq4UvWd/VPW1RJrjd1aCUIfPIojFXrWMb8R54vVerU2TwjdQ==.ed25519',
  id: '@1nf1T1tUSa43dWglCHzyKIxV61jG/EeeL1Xq1Nk8I3U=.ed25519' }

*/

License

MIT

ssb-keys-mnemonic's People

Contributors

kylemaas avatar staltz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ssb-keys-mnemonic's Issues

Update chloride

This currently uses chloride 2.2.14. It would be nice if it could use a current version of chloride so we don't have to have multiple copies of chloride and sodium-native included in ssb-browser-demo.

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.