bank-barcode 0.2.0

Generate Finnish virtual bank barcodes
Documentation

bank-barcode

Generate Finnish virtual bank barcodes (pankkiviivakoodi) in Rust.

This crate produces the digit string for both version 4 and version 5 of the Finnish virtual bank barcode as defined in the Finanssiala specification. Bank barcodes may only be printed for IBAN accounts in the FI country.

Usage

Add the crate to your Cargo.toml:

[dependencies]
bank-barcode = "0.2"

Then build a barcode through BarcodeBuilder and format it via its Display implementation:

let barcode = bank_barcode::Barcode::builder()
    .version(bank_barcode::BarcodeVersion::V4)
    .account_number("FI16 8000 1400 0502 67")
    .reference(12345)
    .calendar_due_date(2025, 2, 26)
    .euros(123)
    .cents(45)
    .build()
    .expect("Builder failed");

println!("{barcode}");

A runnable end-to-end example lives in examples/basic.rs and can be invoked with:

cargo run --example basic

Minimum supported Rust version

bank-barcode builds on Rust 1.88 and later.

License

Licensed under the MIT License.