MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / EncodeListKey

Function EncodeListKey

internal/utils/utils.go:120–125  ·  view source on GitHub ↗
(key []byte, seq uint64)

Source from the content-addressed store, hash-verified

118}
119
120func EncodeListKey(key []byte, seq uint64) []byte {
121 buf := make([]byte, len(key)+8)
122 binary.LittleEndian.PutUint64(buf[:8], seq)
123 copy(buf[8:], key[:])
124 return buf
125}
126
127func DecodeListKey(buf []byte) ([]byte, uint64) {
128 seq := binary.LittleEndian.Uint64(buf[:8])

Callers 15

TestTx_LPushRawFunction · 0.92
TestTx_RPushRawFunction · 0.92
benchmarkListPushFunction · 0.92
benchmarkListPopFunction · 0.92
benchmarkListRangeFunction · 0.92
benchmarkListPeekFunction · 0.92
benchmarkListTrimFunction · 0.92
benchmarkListRemFunction · 0.92
benchmarkListRemByIndexFunction · 0.92
benchmarkListSizeFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestTx_LPushRawFunction · 0.74
TestTx_RPushRawFunction · 0.74
benchmarkListPushFunction · 0.74
benchmarkListPopFunction · 0.74
benchmarkListRangeFunction · 0.74
benchmarkListPeekFunction · 0.74
benchmarkListTrimFunction · 0.74
benchmarkListRemFunction · 0.74
benchmarkListRemByIndexFunction · 0.74
benchmarkListSizeFunction · 0.74