Hacker Zephyr Ticket Generator
Generate custom Hacker Zephyr train tickets with unique IDs, barcodes, and retro aesthetics. Download as PNG instantly.
About
Train ticket generation requires precise layout geometry. A misaligned barcode or truncated passenger name renders a ticket unreadable by both humans and scanners. This generator replicates the Hacker Zephyr boarding pass format - a retro-styled rail ticket with fields for passenger name, origin, destination, car number, seat assignment, and a unique ticketID encoded as a 128-bit hexadecimal string. The barcode strip uses Code 128 subset B encoding logic mapped to vertical bar widths. All rendering occurs on an HTML Canvas element at 1200 × 460 pixels, exported as a lossless PNG. No server round-trip. No chromium dependency. The tool assumes standard rail ticket proportions at a 2.6:1 aspect ratio.
Limitations: the barcode is decorative and does not conform to GS1 scanning standards. The QR-style matrix in the corner is procedurally generated from the ticket hash and is not scannable. For actual transit use, integrate with a certified barcode library. This tool is designed for event passes, hackathon credentials, and creative projects where visual fidelity matters more than machine readability.
Formulas
The ticket ID is derived from the Web Crypto API random value generator:
Where each byte is converted to a zero-padded hexadecimal pair, producing a 16-character string with 264 possible combinations.
The decorative barcode encodes the ticket ID using a simplified Code 128B bar-width mapping:
Each character of the ID maps to a bar of width 1, 2, or 3 pixels, alternating between filled and blank bars. The total barcode strip spans the ticket stub width.
The decorative matrix grid uses a hash-seeded pattern:
Where r = row index, c = column index, and the result determines fill (1) or empty (0). This produces a deterministic, reproducible pattern unique to each ticket.
Reference Data
| Field | Format | Max Length | Example | Notes |
|---|---|---|---|---|
| Passenger Name | Uppercase Alpha | 24 chars | ORPHEUS HACKSWORTH | Auto-truncated with ellipsis |
| Origin Station | Title Case | 20 chars | Burlington, VT | Free text input |
| Destination | Title Case | 20 chars | Los Angeles, CA | Free text input |
| Departure Date | YYYY-MM-DD | 10 chars | 2024-07-15 | ISO 8601 format |
| Departure Time | HH:MM | 5 chars | 09:30 | 24-hour clock |
| Car Number | Integer | 1 - 99 | 7 | Leading zero added if single digit |
| Seat | Alpha + Number | 4 chars | A12 | Row letter + seat number |
| Ticket Class | Enum | - | HACKER | HACKER, FIRST, COACH, SLEEPER |
| Ticket ID | Hex String | 16 chars | 7A3F..B2C1 | Auto-generated, cryptographically random |
| Canvas Width | Pixels | 1200 | 1200 | Fixed export resolution |
| Canvas Height | Pixels | 460 | 460 | Fixed export resolution |
| Barcode Type | Decorative Code 128B | 64 bars | - | Visual only, not scannable |
| Color Theme | HSL Palette | - | Deep Purple | 6 preset themes available |
| Export Format | PNG | - | ticket.png | Lossless, transparent-free |
| DPI Equivalent | 144 PPI | - | - | Retina-ready at 2x |