mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-03 03:35:19 +00:00
* libs/common: Refactor libs/common 4 - move byte function out of cmn to its own pkg - move tempfile out of cmn to its own pkg - move throttletimer to its own pkg ref #4147 Signed-off-by: Marko Baricevic <marbar3778@yahoo.com> * add changelog entry * fix linting issues
11 lines
276 B
Go
11 lines
276 B
Go
package bytes
|
|
|
|
// Fingerprint returns the first 6 bytes of a byte slice.
|
|
// If the slice is less than 6 bytes, the fingerprint
|
|
// contains trailing zeroes.
|
|
func Fingerprint(slice []byte) []byte {
|
|
fingerprint := make([]byte, 6)
|
|
copy(fingerprint, slice)
|
|
return fingerprint
|
|
}
|