idnumbers
    Preparing search index...

    The Social Security Number of Switzerland. This page is generated from the registry metadata of the library.

    Property Value
    Country code CHE, CH
    ID type Social Security Number
    Official name AHV-Nr. / No AVS
    Also known as Social Security Number; AHV-Nr.; No AVS
    Display format 756.XXXX.XXXX.XX
    Input masks ###.####.####.##
    Length 13 to 16
    Example 756.1234.5678.97
    Checksum yes
    Checksum algorithm EAN-13 check digit
    Parsable no

    The root entry registers every country:

    import { validateNationalId } from 'idnumbers';

    validateNationalId('CHE', '756.1234.5678.97').isValid; // true

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

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

    register(country);
    validateNationalId('CHE', '756.1234.5678.97').isValid; // true