mirror of
https://git.eta.st/eta/rsp6-decoder.git
synced 2025-12-30 04:56:47 +00:00
775e560d100f86c458366e09a9f1679b07b20c26
I had to do crimes to get it to work (changing the realloc function), and I'd like the crimes to be checked in to source control for future eta :p
rsp6-decoder
This is a set of tools to decode UK National Rail electronic ticket barcodes, specifically RSP6 format, as explained in the blog post "Reversing UK mobile rail tickets".
If you're interested in a working demo, check out the hosted version at eta.st/tickets/.
What's in this repo?
- This repo is primarily a Rust crate that can decode these tickets, given a scanned barcode string (starting with
06...). Look at thedecode_ticketfunction for the main entry point. - A website that embeds the crate for demo purposes (powering the hosted version) is inside
rsp6-webshite/.- This will require compiling the main crate for WASM using
wasm-pack build --features wasm. - If you get errors decoding at runtime, you might need to replace references to
wbindgen_reallocinpkg/rsp6_decoder_bg.jswithundefined. It's unclear why this happens.
- This will require compiling the main crate for WASM using
spec.pdfhas a janky table showing what all the fields in a decoded ticket look like.spec.odsis the janky spreadsheet that was used to make this.
keys.jsonhas a copy of all the ticket public keys, as of 2023-01.decode.pywas a hacky Python script to make these from some binary plist I found at some point. You can ignore it.
License
This is all MIT. Please go forth and use it to make your own ticket stuff!
Languages
JavaScript
41%
Rust
38.8%
HTML
16.3%
Common Lisp
2.1%
Python
1.8%