lanka-validations - v2.1.0
    Preparing search index...

    Function convertOldToNewNic

    • Converts a 10-character Old Sri Lankan NIC (9 digits + V/X) into a 12-digit New NIC. Format: 19YY + DDD + 0 + SSS + C Example: 921234567V -> 199212304567

      Parameters

      • oldNic: unknown

        Old-format NIC (9 digits + V/X).

      • Optionaloptions: NicOptions

        Optional { referenceDate } used for age and future-date checks. Defaults to today.

      Returns string | null

      The equivalent 12-digit NIC, or null if the input is not a valid old-format NIC.

      convertOldToNewNic('921234567V'); // '199212304567'