增加一致性hash的简单实现
This commit is contained in:
22
consistent_hash/define.go
Normal file
22
consistent_hash/define.go
Normal file
@ -0,0 +1,22 @@
|
||||
// Package consistent_hash...
|
||||
//
|
||||
// Description : consistent_hash...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-11-21 4:49 下午
|
||||
package consistent_hash
|
||||
|
||||
import "hash/crc32"
|
||||
|
||||
// HashFunc 哈希函数定义
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 4:50 下午 2021/11/21
|
||||
type HashFunc func(data []byte) uint32
|
||||
|
||||
var (
|
||||
// DefaultHashFunc 默认的哈希函数
|
||||
DefaultHashFunc = crc32.ChecksumIEEE
|
||||
)
|
Reference in New Issue
Block a user