mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-23 07:16:47 +00:00

* Replace default hasher (Double-SHA256) with domain seperated blake2b * Replace all hashes with domain seperated blake2b * Update the genesis blocks * Replace OP_HASH256 with OP_BLAKE2B * Fix the merkle tree by appending zeros instead of duplicating the hash when there is 1 branch left * Update tests * Add a payloadHash function * Update gitignore to ignore binaries * Fix a bug in the blake2b opcode
11 lines
283 B
Go
11 lines
283 B
Go
package hashes
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// PayloadHash returns the payload hash.
|
|
func PayloadHash(payload []byte) *externalapi.DomainHash {
|
|
writer := NewPayloadHashWriter()
|
|
writer.InfallibleWrite(payload)
|
|
return writer.Finalize()
|
|
}
|