Skip to content

cersimo97/codifisc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codifisc

npm Featured on Openbase

Utility to encode and decode italian TIN (Codice Fiscale)

Usage

const { encodeCF, decodeCF } = require('codifisc')

let cf = encodeCF({ firstName, lastName, isFemale, birthdate, birthCity })
let obj = decodeCF(cf)
//
// obj = {
//     year: '00',
//     month: 0,
//     day: 0,
//     isFemale: true/false,
//     city: ''
// }

CLI

  Usage: index.js [options] [command]

  Commands:
    decode   Decode a CF string and extract related data
    encode   Encode a CF string from data
    help     Display help
    version  Display version

  Options:
    -n, --birthdate  Date of birth (milliseconds)
    -c, --city       City of birth
    -f, --firstname  First name
    -h, --help       Output usage information
    -l, --lastname   Last name
    -m, --male       Male person (disabled by default)
    -v, --version    Output the version number

  Examples:
    - Encode a CF string from data
    $ codifisc encode -f <firstname> -l <lastname> -n <000000000000> -c <city>

    - Extract info from CF string
    $ codifisc decode CRNSMN92L51L400G

About

Utility to encode and decode italian TIN (Codice Fiscale)

Resources

License

Stars

Watchers

Forks

Packages

No packages published