Hawkynt

Baudot Code (ITA2)

5-bit character encoding used in early teleprinters and telegraph systems. Uses two modes (LETTERS and FIGURES) selected by special shift characters. Educational implementation of International Telegraph Alphabet No. 2 (ITA2/CCITT-2). ITA2 has only 32 five-bit code points per mode and no concept of letter case, so it can only represent the exact uppercase letters, digits, and punctuation listed in its LETTERS/FIGURES tables (plus space, CR, LF and NUL) - any other byte, including lowercase letters and arbitrary binary data, is rejected rather than silently folded or dropped.

Properties

Property Value
Category Encoding Schemes
Sub-category Telegraph Encoding
Security status πŸŽ“ Educational Only
Complexity Beginner
Inventor Γ‰mile Baudot
Year 1874
Origin πŸ‡«πŸ‡· France
Restricted input domain Yes
Source algorithms/encoding/baudot.js

Security

Status: πŸŽ“ Educational Only

No vulnerabilities are recorded for this implementation.

Documentation

References

Test vectors

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

Vector 1 β€” Baudot empty string test

Field Value
input (empty)
expected (empty)

Vector 2 β€” Single letter A test - Baudot ITA2

Field Value
input 41
expected 03

Vector 3 β€” Letter E encoding test - Baudot

Source: ITU-T F.1 standard

Field Value
input 45
expected 01

Vector 4 β€” NUL-A-NUL regression test - code point 0 (β€˜\0’) must round-trip; it was previously unencodable because β€˜\0’ is falsy in JavaScript

Field Value
input 004100
expected 000300

← All algorithms