github.com/vipernet-xyz/tm@v0.34.24/libs/bytes/byteslice.go (about)

     1  package bytes
     2  
     3  // Fingerprint returns the first 6 bytes of a byte slice.
     4  // If the slice is less than 6 bytes, the fingerprint
     5  // contains trailing zeroes.
     6  func Fingerprint(slice []byte) []byte {
     7  	fingerprint := make([]byte, 6)
     8  	copy(fingerprint, slice)
     9  	return fingerprint
    10  }