MCPcopy Index your code
hub / github.com/CodisLabs/codis / Hash

Function Hash

pkg/proxy/mapper.go:293–304  ·  view source on GitHub ↗
(key []byte)

Source from the content-addressed store, hash-verified

291}
292
293func Hash(key []byte) uint32 {
294 const (
295 TagBeg = '{'
296 TagEnd = '}'
297 )
298 if beg := bytes.IndexByte(key, TagBeg); beg >= 0 {
299 if end := bytes.IndexByte(key[beg+1:], TagEnd); end >= 0 {
300 key = key[beg+1 : beg+1+end]
301 }
302 }
303 return crc32.ChecksumIEEE(key)
304}
305
306func getHashKey(multi []*redis.Resp, opstr string) []byte {
307 var index = 1

Callers 2

dispatchMethod · 0.85
TestHashSlotFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestHashSlotFunction · 0.68