UK Postcode Binary Encoder
github.com·20w·
Discuss: Hacker News

UK Postcode Binary Encoder

A high-performance, ultra-compact binary format for UK postcode geolocation data. Compresses 1.79M postcodes from ~50MB CSV to just 6.2MB binary (88% compression) with 920K+ lookups/second and O(1) exact lookups.

🌐 Try the Live Demo →

Architecture

The implementation is split into focused, reusable classes:

Core Classes

  • PostcodeEncoder - Main orchestrator class that coordinates the encoding process
  • PostcodeNormalizer - Handles postcode validation, normalization, and inward ID encoding
  • BitmapManager - Manages 4000-bit presence bitmaps and rank directories for each outward
  • BinaryFileWriter - Handles the binary file format layout and writing
  • **`BitWrite…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help