idnumbers
    Preparing search index...

    The Social Insurance Number of Canada. This page is generated from the registry metadata of the library.

    Property Value
    Country code CAN, CA
    ID type Social Insurance Number
    Official name Social Insurance Number (SIN)
    Also known as Social Insurance Number; SIN
    Display format ###-###-###
    Input masks ###-###-###
    Length 9 to 11
    Example 123-456-782
    Checksum yes
    Checksum algorithm Luhn (mod 10)
    Parsable no

    The root entry registers every country:

    import { validateNationalId } from 'idnumbers';

    validateNationalId('CAN', '123-456-782').isValid; // true

    To bundle only this country, import its definition from idnumbers/countries/can and pass it to register():

    import { register, validateNationalId } from 'idnumbers/core';
    import { country } from 'idnumbers/countries/can';

    register(country);
    validateNationalId('CAN', '123-456-782').isValid; // true