Hawkynt

BSD-Checksum

BSD Unix checksum algorithm using rotating 16-bit sum. Rotates checksum right by 1 bit before adding each byte. Used by BSD β€˜sum’ command for file integrity verification.

Properties

Property Value
Category Checksums
Sub-category Rotating Sum
Security status πŸŽ“ Educational Only
Complexity Beginner
Inventor BSD Unix developers
Year 1977
Origin πŸ‡ΊπŸ‡Έ United States
Source algorithms/checksum/bsd-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 β€” Single character

Source: BSD checksum calculation

Field Value
input 61
expected 0061

Vector 2 β€” Three characters

Source: BSD checksum with rotation

Field Value
input 616263
expected 40ac

Vector 3 β€” Maximum bytes

Source: BSD checksum overflow handling

Field Value
input ffff
expected 817e

← All algorithms