This is a small crate that is able to validate an IBAN account number.
The crate can be found on crates.io. To use this crate, just add it as an dependency:
[dependencies]
iban_validate = "1.0.2"
This crate provides an easy way to validate an IBAN (International Bank Account Number). To do so, you can use the
function [parse()
]. If you want to check whether the address has a valid BBAN (Basic Bank Account Number), you can
use [validate_bban()
]. It also contains some helper methods to make handling an IBAN easier.
The following example does a full validation of the IBAN and BBAN format.
```rust use iban::Iban; use iban::BbanResult;
let account = "DE44500105175407324931".parse::
asserteq!(account.validatebban(), BbanResult::Valid); asserteq!(account.getcountrycode(), "DE"); asserteq!(account.getcheckdigits(), 44); asserteq!(account.getbban(), "500105175407324931"); ```
The full documentation is available at docs.rs.
If you experience issues with this crate or want to help, please look here.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.