Longitudinal parity check using XOR of all bytes for multi-byte error detection Fundamental error detection using XOR operations.
| Property | Value |
|---|---|
| Category | Checksums |
| Sub-category | Parity Check |
| Security status | π Educational Only |
| Complexity | Beginner |
| Inventor | Richard Hamming |
| Year | 1950 |
| Origin | πΊπΈ United States |
| Source | algorithms/checksum/parity.js |
Status: π Educational Only
| Issue | Description | Mitigation |
|---|---|---|
| Single Error Detection Only | Can only detect odd numbers of bit errors, not even numbers | β |
| No Correction Capability | Can detect errors but cannot correct them | β |
| Weak Against Burst Errors | Poor performance against consecutive bit errors | β |
4 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.
Vector 1 β Empty data
Source: XOR of empty data is 0
| Field | Value |
|---|---|
input |
(empty) |
expected |
00 |
Vector 2 β Bytes 0xAA, 0x55
Source: XOR result is 0xFF
| Field | Value |
|---|---|
input |
aa55 |
expected |
ff |
Vector 3 β Bytes 0x12, 0x34, 0x56
Source: XOR result is 0x70
| Field | Value |
|---|---|
input |
123456 |
expected |
70 |
Vector 4 β Four bytes of 0xFF
Source: Even number of identical bytes XOR to 0
| Field | Value |
|---|---|
input |
ffffffff |
expected |
00 |