HAFAS Bitmask Calculator
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.
π What is HAFAS?
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.
β¨ Features
- π’ 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
π Technology
- React + Vite
- Plain CSS for styling
- No external UI libraries
- Fully static β can be deployed to GitHub Pages, Netlify, etc.
Structure
1 |
|
Related Projects
hafas-client β JavaScript client for HAFAS public transport APIs.
Mobiliteit.lu β Real-Time tracking of bus lines across Luxembourg
HAFAS Bitmask Calculator
https://greenmeeple.github.io/projects/hafas-bitmask-calculator/