mirror of
https://github.com/markspanbroek/mnemonic
synced 2026-01-08 23:01:07 +00:00
No description
| mnemonic | ||
| tests | ||
| .editorconfig | ||
| .gitignore | ||
| .tool-versions | ||
| license | ||
| mnemonic.nim | ||
| mnemonic.nimble | ||
| readme.md | ||
Mnemonic
Create memorable sentences from byte sequences. Uses a reversible method that is very similar to Bitcoin's BIP39.
Examples
Generate a random key and encode it into a mnemonic:
import sysrandom
import mnemonic
let key = getRandomBytes(32)
let mnemonic = encode(key)
Decode a mnemonic into bytes:
let decoded = decode(mnemonic) # equals key