Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HAFAS Bitmask Calculator

Web Demo

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:

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

.
├── assets        # static scripts and assets for demo
├── index.html  # demo entry
└── react   # react source code

Related Projects

hafas-client -- JavaScript client for HAFAS public transport APIs. Mobiliteit.lu -- Real-Time tracking of bus lines across Luxembourg


📜 License

MIT © 2024 [Alex Li]

About

A simple web-based tool to help you decode and encode bitmasks used by the HAFAS API.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages