Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add encode_seed function #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JaredCorduan
Copy link

hello again :)

This PR provides the inverse of the existing function decode_seed, a new function named encode_seed which takes a bytestring of length 32 and produces an nkey-encoded seed.

This function can be used to generate nkeys, with the onus of providing proper entropy left to the user. I believe this would resolve #3.

I added a low-tech property test, which checks that encoding followed by decoding is just the identity function. I am a big fan of hypothesis, but I was not sure the appetite here for adding new dependencies.

nkeys/nkeys.py Outdated Show resolved Hide resolved
This function takes a bystring of length 32 and produces an nkey-encoded
seed. This function can be used to generate nkeys (with the onus of
providing proper entropy left to the user).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing functions to generate nkeys
2 participants