MCPcopy Create free account
hub / github.com/apache/fory / smallMetaStringWords

Function smallMetaStringWords

go/fory/meta_string_resolver.go:338–343  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

336}
337
338func smallMetaStringWords(data []byte) pair {
339 if len(data) <= 8 {
340 return pair{bytesToInt64(data), 0}
341 }
342 return pair{int64(binary.LittleEndian.Uint64(data[:8])), bytesToInt64(data[8:])}
343}
344
345func computeSmallMetaStringHash(words pair, length int, encoding meta.Encoding) int64 {
346 hash := uint64(words[0]*31+words[1]) ^ (uint64(length) << 56)

Callers 3

ReadMetaStringBytesMethod · 0.85
GetMetaStrBytesMethod · 0.85
ComputeMetaStringHashFunction · 0.85

Calls 2

bytesToInt64Function · 0.85
int64Function · 0.50

Tested by

no test coverage detected