You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
276 B

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