(timestamp uint64, hash uint64, key string, entry []byte, buffer *[]byte)
| 12 | ) |
| 13 | |
| 14 | func wrapEntry(timestamp uint64, hash uint64, key string, entry []byte, buffer *[]byte) []byte { |
| 15 | keyLength := len(key) |
| 16 | blobLength := len(entry) + headersSizeInBytes + keyLength |
| 17 | |
| 18 | if blobLength > len(*buffer) { |
| 19 | *buffer = make([]byte, blobLength) |
| 20 | } |
| 21 | blob := *buffer |
| 22 | |
| 23 | binary.LittleEndian.PutUint64(blob, timestamp) |
| 24 | binary.LittleEndian.PutUint64(blob[timestampSizeInBytes:], hash) |
| 25 | binary.LittleEndian.PutUint16(blob[timestampSizeInBytes+hashSizeInBytes:], uint16(keyLength)) |
| 26 | copy(blob[headersSizeInBytes:], key) |
| 27 | copy(blob[headersSizeInBytes+keyLength:], entry) |
| 28 | |
| 29 | return blob[:blobLength] |
| 30 | } |
| 31 | |
| 32 | func appendToWrappedEntry(timestamp uint64, wrappedEntry []byte, entry []byte, buffer *[]byte) []byte { |
| 33 | blobLength := len(wrappedEntry) + len(entry) |
no outgoing calls
searching dependent graphs…