MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / put_int_be

Function put_int_be

internal/cbm/sqlite_writer.c:277–282  ·  view source on GitHub ↗

Write integer in big-endian for given byte count

Source from the content-addressed store, hash-verified

275
276// Write integer in big-endian for given byte count
277static void put_int_be(uint8_t *buf, int64_t val, int nbytes) {
278 for (int i = nbytes - SKIP_ONE; i >= 0; i--) {
279 buf[i] = (uint8_t)(val & BYTE_MASK);
280 val >>= SHIFT_8;
281 }
282}
283
284// Write a 2-byte big-endian value
285static void put_u16(uint8_t *buf, uint16_t val) {

Callers 1

rec_add_intFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected