initial import
This commit is contained in:
8
example/siphash/sharding.go
Normal file
8
example/siphash/sharding.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package sharding
|
||||
|
||||
import "github.com/dchest/siphash"
|
||||
|
||||
func sharding(token string) uint64 {
|
||||
sum := siphash.Hash(0, 0, []byte(token))
|
||||
return sum % 3
|
||||
}
|
||||
Reference in New Issue
Block a user