Hawkynt

XOR-8

Simple XOR-based checksum used in NMEA GPS sentences and serial communication protocols. XORs all input bytes to produce a single-byte error detection value.

Properties

Property Value
Category Checksums
Sub-category XOR-based
Security status 🎓 Educational Only
Complexity Beginner
Inventor Unknown (ancient technique)
Year 1960
Origin Not specified
Source algorithms/checksum/xor-checksum.js

Security

Status: 🎓 Educational Only

No vulnerabilities are recorded for this implementation.

Notes

Documentation

References

Test vectors

3 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.

Vector 1 — NMEA sentence type

Field Value
input 4750524d43
expected 4b

Vector 2 — Simple sequence

Source: XOR checksum calculation

Field Value
input 01020304
expected 04

Vector 3 — ASCII test

Source: XOR checksum test

Field Value
input 414243
expected 40

← All algorithms