Is there a convenient function to get a hypercore's discovery key from its public key?
I know I can use myCore.key
and myCore.discoveryKey
in hypersdk
But if you just had a key as a hex string (e.g. "778f8d955175c92e4ced5e4f5563f69bfec0c86cc6f670352c457943666fe639"), how would you get the discovery key?
Is there a convenience function in one of the hypercore-protocol modules?
Note, the discovery key is the blake2b-256 hash of the public key.
I used the
hypercore-crypto
module:Gives a discovery key of: