Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generating a seed: a general approach
# The snippet is a part of the IOTA Developer Essentials project. You can reach it at
# Complete description and story behind the snippet is available at:
import random
chars=u'9ABCDEFGHIJKLMNOPQRSTUVWXYZ' #27 characters - max number you can express by one Tryte - do you remember?
rndgenerator = random.SystemRandom() #cryptographically secure pseudo-random generator
NewSeed = u''.join(rndgenerator.choice(chars) for _ in range(81)) #generating 81-chars long seed. This is Python 3.6+ compatible
print("Length: %s" % len(NewSeed))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment