UK Postcode Binary Encoder
github.comยท11hยท
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...