Skip to content

CANADA_SIN (Canadian Social Insurance Number) filter. A first-class entity

Source: canada-sin.phisql (spec v1.3.0)

PhiSQL

-- CANADA_SIN (Canadian Social Insurance Number) filter. A first-class entity
-- type for the nine-digit SIN, written unformatted or in three groups of three
-- (e.g. 130-246-804). Every match must pass the Luhn check. It is its own
-- filter, so SINs are labelled canada-sin rather than as a custom identifier,
-- with no pattern for the policy author to write. The optional
-- onlyValidPrefixes flag (default FALSE) drops values beginning with 0 or 8,
-- which are not issued to individuals; it is set through the filter OPTIONS
-- passthrough, like EIN's flag of the same name. Added to schema 1.3.0 in place
-- (additive). Compiles to canada-sin.json.

POLICY canada_sin;

REDACT CANADA_SIN WITH MASK OPTIONS (onlyValidPrefixes = TRUE);

Compiles to

{
  "identifiers": {
    "canadaSin": {
      "canadaSinFilterStrategies": [
        {
          "strategy": "MASK"
        }
      ],
      "onlyValidPrefixes": true
    }
  }
}