mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-09-14 05:20:11 +00:00
14 lines
420 B
Go
14 lines
420 B
Go
package binaryserialization
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// SerializeHash serializes hash to a slice of bytes
|
|
func SerializeHash(hash *externalapi.DomainHash) []byte {
|
|
return hash.ByteSlice()
|
|
}
|
|
|
|
// DeserializeHash a slice of bytes to a hash
|
|
func DeserializeHash(hashBytes []byte) (*externalapi.DomainHash, error) {
|
|
return externalapi.NewDomainHashFromByteSlice(hashBytes)
|
|
}
|