Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/falti/ex_nric
Validation for National Registration Identity Card numbers (NRIC)
https://github.com/falti/ex_nric
checksum-calculation elixir nric validation
Last synced: 7 days ago
JSON representation
Validation for National Registration Identity Card numbers (NRIC)
- Host: GitHub
- URL: https://github.com/falti/ex_nric
- Owner: falti
- License: mit
- Created: 2019-03-12T21:39:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-11T10:18:35.000Z (about 3 years ago)
- Last Synced: 2024-09-14T12:07:57.818Z (about 2 months ago)
- Topics: checksum-calculation, elixir, nric, validation
- Language: Elixir
- Size: 13.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Validation for Singapore National Registration Identity Card numbers (NRIC). (Validations)
- fucking-awesome-elixir - ex_nric - Validation for Singapore National Registration Identity Card numbers (NRIC). (Validations)
- awesome-elixir - ex_nric - Validation for Singapore National Registration Identity Card numbers (NRIC). (Validations)
README
# ExNric
[![Hex.pm Version](http://img.shields.io/hexpm/v/ex_nric.svg?style=flat)](https://hex.pm/packages/ex_nric)
* [Documentation](https://hexdocs.pm/ex_nric)
## AboutValidation for Singapore National Registration Identity Card numbers (NRIC)
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `ex_nric` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:ex_nric, "~> 0.2.0"}
]
end
```Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/ex_nric](https://hexdocs.pm/ex_nric).## Usage
```elixir
import ExNric
{:ok, "S7343684B"} = validate("S7343684B")
{:error, :invalid_format} = validate("x")
{:error, :invalid_format} = validate("x")
{:error, :checksum_error} = validate("G0047750U")```
## Contributing
Pull requests to contribute new or improved features, and extend documentation are most welcome.
Please follow the existing coding conventions, or refer to the [Elixir style guide](https://github.com/niftyn8/elixir_style_guide).
You should include unit tests to cover any changes. Run `mix test` to execute the test suite.
You should also ensure that dialyzer checks pass. Run `mix dialyzer` to verify.