NUBAN 1.1.2

dotnet add package NUBAN --version 1.1.2                
NuGet\Install-Package NUBAN -Version 1.1.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NUBAN" Version="1.1.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NUBAN --version 1.1.2                
#r "nuget: NUBAN, 1.1.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NUBAN as a Cake Addin
#addin nuget:?package=NUBAN&version=1.1.2

// Install NUBAN as a Cake Tool
#tool nuget:?package=NUBAN&version=1.1.2                

NUBAN Generation Library

Introduction

This library provides a simple and efficient implementation of the Central Bank of Nigeria's (CBN) revised standards on Nigeria Uniform Bank Account Number (NUBAN) generation for banks and other financial institutions. The NUBAN system is designed to create unique and consistent bank account numbers in Nigeria.

CBN Revised NUBAN Generation Standards

For a detailed understanding of the CBN's revised NUBAN generation standards, please refer to the official CBN document: CBN Revised NUBAN Generation Standards (PDF).

Features

  • Generate valid NUBAN account numbers based on the provided serial number and bank code.
  • Validate NUBAN account numbers for accuracy.

Installation

To use this library in your .NET projects, you can install it via NuGet Package Manager. Use the following command:

dotnet add package NUBAN 

or

NuGet\Install-Package NUBAN 

Usage

Generating a NUBAN Account Number

To generate a NUBAN account number, you can use the CreateAccount method. Provide the serial number and bank code as input parameters.

using NUBAN;

// ...

string serialNumber = "123456789";
string bankCode = "012";
string nuban = NubanUtility.CreateAccount(serialNumber, bankCode);
Console.WriteLine($"Generated NUBAN: {nuban}");

Validating a NUBAN Account Number

To validate a NUBAN account number, you can use the IsBankAccountValid method. Provide the account number and bank code as input parameters.

using NUBAN;

// ...

string accountNumber = "0123456789";
string bankCode = "012";
bool isValid = NUBANUtility.IsBankAccountValid(accountNumber, bankCode);
Console.WriteLine($"Is Valid NUBAN: {isValid}");

infer bank(s) from account number


using NUBAN;

// Example usage
string accountNumber = "0000214579";
string bankCode = "044";

static List<Bank> Banks = new List<Bank>
{
    new Bank { Name = "ACCESS BANK", Code = "044" },
    new Bank { Name = "CITIBANK", Code = "023" },
    // Add other banks here
};

List<Bank> inferredBanks = GetAccountBanks(accountNumber, Banks);

if (inferredBanks.Count > 0)
{
    Console.WriteLine("Valid Banks:");
    foreach (var bank in inferredBanks)
    {
        Console.WriteLine($"Name: {inferredBanks.Name}, Code: {inferredBanks.Code}");
    }
}
else
{
    Console.WriteLine("No banks found for the account number.");
}


static List<Bank> GetAccountBanks(string accountNumber)
{
    List<Bank> validBanks = new List<Bank>();

    foreach (var bank in Banks)
    {
        if (NUBANUtility.IsBankAccountValid(accountNumber, bank.Code))
        {
            validBanks.Add(bank);
        }
    }

    return validBanks;
}

🌟 Whats New

1. Get Up to date banks in Nigeria

// Example usage
using NUBAN;

Console.WriteLine("=========All Nigerian Banks=====================");


foreach (var bank in await NUBANUtility.GetBanksAsync())
{
    Console.WriteLine($"{bank.name} - {bank.code}");
}

2. Infer Bank(s) of an account number

// Example usage
using NUBAN;

var accountNumber = "0589902233";

Console.WriteLine($"Banks for {accountNumber}: ");

foreach (var bank in await NUBANUtility.InferBanksAsync(accountNumber))
{
    Console.WriteLine($"{bank.name} - {bank.code}");
}


Versioning

This library follows Semantic Versioning (SemVer). The version number is specified in the project file (.csproj) and is used when creating NuGet packages.

License

This library is provided under the MIT License.

Contributing

Contributions and feedback are welcome! Please feel free to open issues or submit pull requests on our GitHub repository.

Author

Chidiebube

Acknowledgments

This library was created based on the CBN's revised NUBAN generation standards.


Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.2 2,464 9/14/2023
1.0.2 392 9/11/2023