Bankster
An IBAN account numbers and BIC validation tool for Elixir.
Install / Use
/learn @railsmechanic/BanksterREADME
Bankster
An easy to use Elixir validator for IBAN account and BIC numbers. It includes IBAN rules for 115 countries and validation for BIC numbers.
- IBAN validation is done using format, country, length and checksum.
- BIC validation is done using format.
Installation
The package can be installed as Hex package:
- Add bankster to your list of dependencies in
mix.exs:
def deps do
[{:bankster, "~> 0.4.0"}]
end
- Run
mix deps.getto fetch the package from hex
Usage
Validate IBANs
You can either use Bankster.iban_valid?/1 or Bankster.Iban.valid?/1 to validate IBANs.
iex> Bankster.iban_valid?("NOTVALID")
false
iex> Bankster.Iban.valid?("NOTVALID")
false
Validation with errors
Beside the boolean validation function, Bankster offers a validation function which returns the corresponding error.
Like the other validation, you can use Bankster.iban_validate/1 or Bankster.Iban.validate/1 to validate IBANs.
iex> Bankster.iban_validate("NOTVALID")
{:error, :invalid_country}
iex> Bankster.Iban.validate("DK8387188644726815223423423423423423423")
{:error, :invalid_length}
iex> Bankster.Iban.validate("DK83 8718 8644 7268 15")
{:ok, "DK8387188644726815"}
Validate BICs
Validating BICs works the same way as already shown for IBANs.
So you can either use Bankster.bic_valid?/1 or Bankster.Bic.valid?/1 to validate BICs.
iex> Bankster.bic_valid?("NOTVALID")
false
iex> Bankster.Bic.valid?("NOTVALID")
false
License
Bankster source code is released under MIT License. Check LICENSE file for more information.
Related Skills
node-connect
351.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
