2024-01-03 09:56:10 +00:00
|
|
|
package utils
|
|
|
|
|
|
|
|
import "bytes"
|
|
|
|
|
|
|
|
func ConcatBytes(slices ...[]byte) []byte {
|
|
|
|
return bytes.Join(slices, nil)
|
|
|
|
}
|
2024-01-03 13:27:04 +00:00
|
|
|
|
|
|
|
func HashCode(bytes []byte) int {
|
|
|
|
if len(bytes) < 4 {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
return int(bytes[0]) |
|
|
|
|
int(bytes[1])<<8 |
|
|
|
|
int(bytes[2])<<16 |
|
|
|
|
int(bytes[3])<<24
|
|
|
|
}
|