Skip to content

nip10/validate-pt-id

Repository files navigation

Validate Portuguese Ids

npm version

Validate and generate CC (Citizen Identity Card) and NIF (Personal Tax Number) numbers.

Supports ESM and CommonJS (require/import).

Installation

$ yarn add validate-pt-id
$ npm install validate-pt-id
$ pnpm install validate-pt-id

Usage

import { generateNif } from 'validate-pt-id';

const nif = generateNif(); // 238043266
import { validateNif } from 'validate-pt-id';

const isValidNif = validateNif('238043266'); // true
import { generateCc } from 'validate-pt-id';

const cc = generateCc(); // 168893797ZY2
import { validateCc } from 'validate-pt-id';

const isValidCc = validateCc('168893797ZY2'); // true

About

Validate Portuguese Ids such as CC and NIF

Resources

License

Stars

Watchers

Forks

Packages

No packages published