This is a simple web-based tool to help you decode and encode bitmasks used by the HAFAS (HaCon Fahrplan-Auskunfts-System) API.
It visually maps a decimal bitmask to the transport modes it represents and vice versa.
HAFAS is a timetable and journey planning system widely used across European transport networks, including:
- Deutsche Bahn (DB)
- SaarVV
- Luxembourg Mobilitéit
- Many other regional operators
In HAFAS APIs, transport modes (ICE trains, buses, trams, ferries, etc.) are often encoded in a bitmask —
a single number where each bit (1, 2, 4, 8, ...) represents a specific type of transport.
- 🔢 Enter a number to decode it into selected transport modes
- ✅ Click transport icons to encode a bitmask value
- 🔄 Switch between different mode sets (DB, SaarVV, Luxembourg, HAFAS client spec)
⚠️ Input capped to valid 11-bit range (0–2047)- 💡 Uses the official hafas-client mode bitmask as one profile
- React + Vite
- Plain CSS for styling
- No external UI libraries
- Fully static — can be deployed to GitHub Pages, Netlify, etc.
.
├── assets # static scripts and assets for demo
├── index.html # demo entry
└── react # react source codehafas-client -- JavaScript client for HAFAS public transport APIs. Mobiliteit.lu -- Real-Time tracking of bus lines across Luxembourg
MIT © 2024 [Alex Li]
