tendermint/libs/common/byteslice.go

11 lines
277 B
Go
Raw Normal View History

2015-10-21 12:15:19 -07:00
package common
2017-09-20 02:48:04 -04:00
// Fingerprint returns the first 6 bytes of a byte slice.
// If the slice is less than 6 bytes, the fingerprint
// contains trailing zeroes.
2015-10-21 12:15:19 -07:00
func Fingerprint(slice []byte) []byte {
fingerprint := make([]byte, 6)
copy(fingerprint, slice)
return fingerprint
}