Skip to content

snils ​

The string is a Russian SNILS number with a valid check number: 112-233-445 95.

Signature ​

ts
function snils(msg?: Message): Action<string>
function isSnils(value: string): boolean

Parameters ​

ParameterTypeDescription
msgMessageCustom error message

Error codes ​

CodeWhenDefault message
snilsInvalid checksum or formatInvalid SNILS

You can change the texts: see Messages & i18n.

Notes ​

The last two digits are a check number computed from the first nine.

  • Spaces and dashes are allowed: a masked value can be validated.
  • The isSnils function is available separately — for checks without a schema.
  • Format the input with a mask from tinyval-mask.

Example ​

ts
const Employee = object({ snils: pipe(string(), snils()) });

isSnils('112-233-445 95'); // true

See also ​