package common
|
|
|
|
func Fingerprint(slice []byte) []byte {
|
|
fingerprint := make([]byte, 6)
|
|
copy(fingerprint, slice)
|
|
return fingerprint
|
|
}
|
|
|
|
func RightPadBytes(slice []byte, l int) []byte {
|
|
if l < len(slice) {
|
|
return slice
|
|
}
|
|
padded := make([]byte, l)
|
|
copy(padded[0:len(slice)], slice)
|
|
return padded
|
|
}
|
|
|
|
func LeftPadBytes(slice []byte, l int) []byte {
|
|
if l < len(slice) {
|
|
return slice
|
|
}
|
|
padded := make([]byte, l)
|
|
copy(padded[l-len(slice):], slice)
|
|
return padded
|
|
}
|