common: Fingerprint comment

This commit is contained in:
Ethan Buchman 2017-09-20 02:48:04 -04:00
parent 4e955434aa
commit 9a2438e0dc
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,9 @@ import (
"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)