MCPcopy Create free account
hub / github.com/allegro/bigcache / readKeyFromEntry

Function readKeyFromEntry

encoding.go:61–69  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

59}
60
61func readKeyFromEntry(data []byte) string {
62 length := binary.LittleEndian.Uint16(data[timestampSizeInBytes+hashSizeInBytes:])
63
64 // copy on read
65 dst := make([]byte, length)
66 copy(dst, data[headersSizeInBytes:headersSizeInBytes+length])
67
68 return bytesToString(dst)
69}
70
71func compareKeyFromEntry(data []byte, key string) bool {
72 length := binary.LittleEndian.Uint16(data[timestampSizeInBytes+hashSizeInBytes:])

Callers 9

getWithInfoMethod · 0.85
getMethod · 0.85
getValidWrapEntryMethod · 0.85
setCurrentEntryMethod · 0.85
providedOnRemoveMethod · 0.85
TestEncodeDecodeFunction · 0.85
TestAllocateBiggerBufferFunction · 0.85

Calls 1

bytesToStringFunction · 0.70

Tested by 2

TestEncodeDecodeFunction · 0.68
TestAllocateBiggerBufferFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…