Error `Hypercore key should be 32 bytes` reduces the usefulness of custom `opts.crypto`
Nuhvi opened this issue · comments
Nuh commented
Checking for a 32 bytes publicKey makes is it impossible to use secp256k1 compressed publicKey
https://github.com/hypercore-protocol/hypercore-next/blob/master/index.js#L35
Possible solution:
if (!opts.crypto && key && key.byteLength !== 32) {
throw new Error('Hypercore key should be 32 bytes')
}
Mathias Buus commented
Yea good solution, wanna PR?
Nuh commented
On it.