urbit / urbit-key-generation

Key derivation and HD wallet generation functions for Urbit
MIT License
15 stars 8 forks source link

Specify hex when switching from hex to buffer. #25

Closed jtobin closed 5 years ago

jtobin commented 5 years ago

There were a couple of cases where Buffer.from(foo) was used when moving from a hex-encoded string, when Buffer.from(foo, 'hex') is the correct way to do it. This had an effect on some seeds (which were too big), plus the resulting keys.

jtobin commented 5 years ago

Going to give this a double-check, the hex2buf and buf2hex next to each other in the networkNodes definition are making me suspicious..

jtobin commented 5 years ago

Yeah one of the hex2bufs is superfluous, fixing..

jtobin commented 5 years ago

Yeah, possibly the best thing would be to manage seeds/keys/etc. in terms of buffers, always, and just use strings, hex or otherwise, for rendering output. That's basically what we do now, but we could probably be more structured about it (by using explicit rendering functions, say).