import "github.com/fufuok/utils/xhash"
- func AddBytes32(h uint32, b []byte) uint32
- func AddBytes64(h uint64, b []byte) uint64
- func AddString32(h uint32, s string) uint32
- func AddString64(h uint64, s string) uint64
- func AddUint32(h, u uint32) uint32
- func AddUint64(h uint64, u uint64) uint64
- func Djb33(s string) uint32
- func FnvHash(s string) uint64
- func FnvHash32(s string) uint32
- [func GenHasherK comparable func(K) uintptr](<#func-genhasher>)
- [func GenHasher64K comparable func(K) uint64](<#func-genhasher64>)
- [func GenSeedHasher64K comparable func(maphash.Seed, K) uint64](<#func-genseedhasher64>)
- func Hash(b []byte, h hash.Hash) []byte
- func HashBytes(b ...[]byte) string
- func HashBytes32(b ...[]byte) uint32
- func HashBytes64(b ...[]byte) uint64
- func HashSeedString(seed maphash.Seed, s string) uint64
- func HashSeedUint64(seed maphash.Seed, n uint64) uint64
- func HashString(s ...string) string
- func HashString32(s ...string) uint32
- func HashString64(s ...string) uint64
- func HashUint32(u uint32) uint32
- func HashUint64(u uint64) uint64
- func Hmac(b []byte, key []byte, h func() hash.Hash) []byte
- func HmacSHA1(b, key []byte) []byte
- func HmacSHA1Hex(s, key string) string
- func HmacSHA256(b, key []byte) []byte
- func HmacSHA256Hex(s, key string) string
- func HmacSHA512(b, key []byte) []byte
- func HmacSHA512Hex(s, key string) string
- func MD5(b []byte) []byte
- func MD5BytesHex(bs []byte) string
- func MD5Hex(s string) string
- func MD5Reader(r io.Reader) (string, error)
- func MD5Sum(filename string) (string, error)
- func MemHash(s string) uint64
- func MemHash32(s string) uint32
- func MemHashb(b []byte) uint64
- func MemHashb32(b []byte) uint32
- func MustMD5Sum(filename string) string
- func Sha1(b []byte) []byte
- func Sha1Hex(s string) string
- func Sha256(b []byte) []byte
- func Sha256Hex(s string) string
- func Sha512(b []byte) []byte
- func Sha512Hex(s string) string
- func Sum32(s string) uint32
- func Sum64(s string) uint64
- func SumBytes32(bs []byte) uint32
- func SumBytes64(bs []byte) uint64
- type Hashable
func AddBytes32(h uint32, b []byte) uint32
AddBytes32 adds the hash of b to the precomputed hash value h. Ref: segmentio/fasthash
func AddBytes64(h uint64, b []byte) uint64
AddBytes64 adds the hash of b to the precomputed hash value h. Ref: segmentio/fasthash
func AddString32(h uint32, s string) uint32
AddString32 adds the hash of s to the precomputed hash value h. Ref: segmentio/fasthash
func AddString64(h uint64, s string) uint64
AddString64 adds the hash of s to the precomputed hash value h. Ref: segmentio/fasthash
func AddUint32(h, u uint32) uint32
AddUint32 adds the hash value of the 8 bytes of u to h. Ref: segmentio/fasthash
func AddUint64(h uint64, u uint64) uint64
AddUint64 adds the hash value of the 8 bytes of u to h. Ref: segmentio/fasthash
func Djb33(s string) uint32
Djb33 比 FnvHash32 更快的获取字符串哈希值 djb2 with better shuffling. 5x faster than FNV with the hash.Hash overhead. Ref: patrickmn/go-cache
func FnvHash(s string) uint64
FnvHash 获取字符串的哈希值
func FnvHash32(s string) uint32
FnvHash32 获取字符串的哈希值
func GenHasher[K comparable]() func(K) uintptr
func GenHasher64[K comparable]() func(K) uint64
GenHasher64 返回哈希函数 Ref: smallnest/safemap, alphadose/haxmap, cornelk/hashmap
func GenSeedHasher64[K comparable]() func(maphash.Seed, K) uint64
func Hash(b []byte, h hash.Hash) []byte
func HashBytes(b ...[]byte) string
HashBytes 合并 Bytes, 得到字符串哈希
func HashBytes32(b ...[]byte) uint32
func HashBytes64(b ...[]byte) uint64
func HashSeedString(seed maphash.Seed, s string) uint64
HashSeedString calculates a hash of s with the given seed.
func HashSeedUint64(seed maphash.Seed, n uint64) uint64
HashSeedUint64 calculates a hash of n with the given seed.
func HashString(s ...string) string
HashString 合并一串文本, 得到字符串哈希
func HashString32(s ...string) uint32
func HashString64(s ...string) uint64
func HashUint32(u uint32) uint32
HashUint32 returns the hash of u. Ref: segmentio/fasthash
func HashUint64(u uint64) uint64
HashUint64 returns the hash of u. Ref: segmentio/fasthash
func Hmac(b []byte, key []byte, h func() hash.Hash) []byte
func HmacSHA1(b, key []byte) []byte
func HmacSHA1Hex(s, key string) string
func HmacSHA256(b, key []byte) []byte
func HmacSHA256Hex(s, key string) string
func HmacSHA512(b, key []byte) []byte
func HmacSHA512Hex(s, key string) string
func MD5(b []byte) []byte
func MD5BytesHex(bs []byte) string
func MD5Hex(s string) string
MD5Hex 字符串 MD5
func MD5Reader(r io.Reader) (string, error)
MD5Reader 计算 MD5
func MD5Sum(filename string) (string, error)
MD5Sum 文件 MD5
func MemHash(s string) uint64
MemHash 使用内置的 memhash 获取字符串哈希值
func MemHash32(s string) uint32
MemHash32 使用内置的 memhash 获取字符串哈希值
func MemHashb(b []byte) uint64
MemHashb 使用内置的 memhash 获取哈希值
func MemHashb32(b []byte) uint32
MemHashb32 使用内置的 memhash 获取哈希值
func MustMD5Sum(filename string) string
func Sha1(b []byte) []byte
func Sha1Hex(s string) string
func Sha256(b []byte) []byte
func Sha256Hex(s string) string
func Sha512(b []byte) []byte
func Sha512Hex(s string) string
func Sum32(s string) uint32
Sum32 获取字符串的哈希值
func Sum64(s string) uint64
Sum64 获取字符串的哈希值
func SumBytes32(bs []byte) uint32
SumBytes32 获取 bytes 的哈希值
func SumBytes64(bs []byte) uint64
SumBytes64 获取 bytes 的哈希值
Hashable allowed map key types constraint
type Hashable interface {
// contains filtered or unexported methods
}
Generated by gomarkdoc