paulmillr / noble-curves

Audited & minimal JS implementation of elliptic curve cryptography.
https://paulmillr.com/noble
MIT License
623 stars 56 forks source link

Remove utf8ToBytes definition #52

Closed madeken closed 1 year ago

madeken commented 1 year ago

You already have the utf8ToBytes function in noble-hashes which this project depends on, so you might as well just use it and not redefine it here. Actually the project already is a bit of a mix between calling nobel-curves.utf8ToBytes and nobel-hashes.utf8ToBytes (which isn't a big deal, as they do the same thing, but a bit weird?).

Anyway, not a big deal but I think it's cleaner and selfishly it allows me to only have to patch 1 library instead of 2 (since I'm running in an environment without TextEncoder)

paulmillr commented 1 year ago

Everything inside of abstract directory does not depend on hashes, on purpose.

Reason: user may opt-in into using their own hashing library.

This way, there would be no dependency on hashes.

Duplication is fine, it's only a couple functions.

madeken commented 1 year ago

Fair enough