Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timolinn/nuban
A Rust crate for validating NUBAN, based on CBN guidelines.
https://github.com/timolinn/nuban
banks cbn nigeria nuban rust
Last synced: about 1 month ago
JSON representation
A Rust crate for validating NUBAN, based on CBN guidelines.
- Host: GitHub
- URL: https://github.com/timolinn/nuban
- Owner: timolinn
- License: mit
- Created: 2019-03-18T16:58:34.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-29T15:20:48.000Z (almost 2 years ago)
- Last Synced: 2024-11-21T00:12:04.397Z (about 1 month ago)
- Topics: banks, cbn, nigeria, nuban, rust
- Language: Rust
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NUBAN 🦀
[![Build Status](https://travis-ci.org/timolinn/nuban.svg?branch=master)](https://travis-ci.org/timolinn/nuban)
![crates.io](https://img.shields.io/crates/v/nuban.svg)This is a lightweight Rust crate for verifying NUBAN numbers
for all Nigerian bank accounts as was directed by the CBN.## What does it do?
It checks the validity of a Nigerian bank account number based on the NUBAN guidelines provided by the CBN.
### How to use
```rust
use nuban::Nuban;fn main() {
// pass the bank code and account number as arguments
let nuban = Nuban::new("058", "0739082716").unwrap();
if let Ok(true) = nuban.is_valid_account() {
println!("'{}' is a valid account number", nuban.account_number());
} else {
println!("'{}' is not a valid account number", nuban.account_number());
}
}
```Create a `NUBAN` instance using the conventional `new` method
```rust
let nuban = Nuban::new("098", "1038489302");
```To check validity on a `NUBAN` instance:
```rust
println!("{}", nuban.is_valid_account().unwrap());
```### Contributing
- Create an issue if you spot any bug.
- Feel free to fork and fix or extend the feature.
- Run `cargo test` to ensure all tests are passing.
- Add tests for your new features if you can.
- Send in your pull request 🔥🔥### Other
Like this crate? Please star this repo.
You can give me a shoutout on [Twitter](https://twitter.com/timolinn_)