sharding.go 151 B

12345678
  1. package sharding
  2. import "github.com/dchest/siphash"
  3. func sharding(token string) uint64 {
  4. sum := siphash.Hash(0, 0, []byte(token))
  5. return sum % 3
  6. }