MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / corrupt_last_byte

Function corrupt_last_byte

nodedb/tests/corruption_quarantine.rs:74–78  ·  view source on GitHub ↗

Corrupt the last byte of a segment buffer (flips the footer CRC).

(mut bytes: Vec<u8>)

Source from the content-addressed store, hash-verified

72
73/// Corrupt the last byte of a segment buffer (flips the footer CRC).
74fn corrupt_last_byte(mut bytes: Vec<u8>) -> Vec<u8> {
75 let last = bytes.len() - 1;
76 bytes[last] ^= 0xFF;
77 bytes
78}
79
80// ── columnar corruption ───────────────────────────────────────────────────────
81

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected