norwegian-tin-validator

Crates.ionorwegian-tin-validator
lib.rsnorwegian-tin-validator
version0.1.0
created_at2025-09-05 22:46:22.336427+00
updated_at2025-09-05 22:46:22.336427+00
descriptionA Norwegian TIN (Tax Identification Number) validator library
homepage
repositoryhttps://github.com/khopland/norwegian-tin-validator
max_upload_size
id1826371
size38,087
Kristoffer Larsen Hopland (khopland)

documentation

README

norwegian-tin-validator

A robust Norwegian TIN (Tax Identification Number) validator library supporting both D-numbers and F-numbers, including the new TIN format introduced in 2032. Also supports all synthetic test TINs and all test IDs used by Skatteetaten.

Features

  • Validate Norwegian TINs (F-numbers and D-numbers)
  • Support for new TIN format (from 2032)
  • Handles synthetic test TINs
  • Supports all test IDs used by Skatteetaten
  • Simple API for integration

Installation

Add to your Cargo.toml:

norwegian-tin-validator = "0.1"

Usage

Rust

use norwegian_tin_validator::NorwegianTin;

fn main() {
    let tin = "01010112345";
    if NorwegianTin::parse(tin).is_ok() {
        println!("Valid Norwegian TIN!");
    } else {
        println!("Invalid TIN.");
    }
}

Documentation

License

Apache-2.0 License. See the LICENSE file for details.

Contributing

Contributions and issues are welcome! Please open an issue or pull request on GitHub.

Acknowledgements

Based on official documentation from Skatteetaten.

Commit count: 5

cargo fmt