Hawkynt

UUencode

UUencoding (Unix-to-Unix encoding) binary-to-text encoding developed by Mary Ann Horton at UC Berkeley in 1980. Encodes 3 bytes into 4 characters using printable ASCII characters with space (0x20) offset. Widely used in early email and UUCP systems.

Properties

Property Value
Category Encoding Schemes
Sub-category Binary-to-Text
Security status πŸŽ“ Educational Only
Complexity Beginner
Inventor Mary Ann Horton
Year 1980
Origin πŸ‡ΊπŸ‡Έ United States
Source algorithms/encoding/uuencode.js

Security

Status: πŸŽ“ Educational Only

No vulnerabilities are recorded for this implementation.

Documentation

References

Test vectors

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

Vector 1 β€” UUencode empty string test

Field Value
input (empty)
expected (empty)

Vector 2 β€” UUencode single zero byte test

Field Value
input 00
expected 2020

Vector 3 β€” UUencode single character β€˜M’ test

Field Value
input 4d
expected 3330

Vector 4 β€” UUencode two character β€˜Ma’ test

Field Value
input 4d61
expected 333624

Vector 5 β€” UUencode three character β€˜Man’ test

Field Value
input 4d616e
expected 3336254e

Vector 6 β€” UUencode four character β€˜Test’ test - full 3-byte group (β€˜Tes’) plus a 1-byte tail group (β€˜t’) encoded as its full 2 characters

Field Value
input 54657374
expected 352635533d20

Vector 7 β€” UUencode 128-byte regression test - final group is a 2-byte tail, not the whole input, so the old data.length-based tail check silently dropped its 3rd character

Field Value
input 61616161616161616161616161616161 61616161616161616161616161616161 61616161616161616161616161616161 61616161616161616161616161616161 61616161616161616161616161616161 61616161616161616161616161616161 61616161616161616161616161616161 61616161616161616161616161616161
expected 38362541383625413836254138362541 38362541383625413836254138362541 38362541383625413836254138362541 38362541383625413836254138362541 38362541383625413836254138362541 38362541383625413836254138362541 38362541383625413836254138362541 38362541383625413836254138362541 38362541383625413836254138362541 38362541383625413836254138362541 3836254138362541383624

← All algorithms