ssbc / ssb-keys

keyfile operations for ssb
36 stars 26 forks source link

allow generate() seed arg to be a string #99

Closed staltz closed 2 years ago

staltz commented 2 years ago

Context: For testing, it's worth using deterministic keys, but the API for passing a seed is a bit annoying because you have to craft a buffer yourself and it has to be 32 bytes long.

Solution: this PR allows the seed argument of generate(curve, seed, feedFormat) to be a string, which is then used to produce a 32-byte seed buffer regardless of the size of the seed string.

staltz commented 2 years ago

Ah yeah, let's change it to utf8. It's cooler