Ejemplo n.º 1
0
// Returns the encoded size and the hash of it (avoids duplicate encoding)
func (self *Transaction) SizeHash() (int, cipher.SHA256) {
	b := self.Serialize()
	return len(b), cipher.SumDoubleSHA256(b)
}
Ejemplo n.º 2
0
func (self *BlockHeader) Hash() cipher.SHA256 {
	b1 := encoder.Serialize(*self)
	return cipher.SumDoubleSHA256(b1)
}
Ejemplo n.º 3
0
// Hashes an entire Transaction struct, including the TransactionHeader
func (self *Transaction) Hash() cipher.SHA256 {
	b := self.Serialize()
	return cipher.SumDoubleSHA256(b)
}