예제 #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)
}
예제 #2
0
func (self *BlockHeader) Hash() cipher.SHA256 {
	b1 := encoder.Serialize(*self)
	return cipher.SumDoubleSHA256(b1)
}
예제 #3
0
// Hashes an entire Transaction struct, including the TransactionHeader
func (self *Transaction) Hash() cipher.SHA256 {
	b := self.Serialize()
	return cipher.SumDoubleSHA256(b)
}