# SSN (SsnGenerator)

The [SSN](https://docs.tonic.ai/app/generation/generators/generator-reference/ssn) generator generates a new valid United States Social Security number.

## Link object structure <a href="#generator-api-ssn-link-object" id="generator-api-ssn-link-object"></a>

The SSN generator does not support linking. It can be self-consistent or consistent with another column. You cannot configure differential privacy.

The `metadata` object is populated from the [`RatioMetadata`](https://app.tonic.ai/apidocs/index.html#/models/RatioMetadata) object.

For the SSN generator, `ratio` indicates the percentage of values to format with dashes (123-45-6789). The percentage is provided as a decimal value between 0 and 1.0.

The remaining values are formatted as 123456789.

```json
{
  "schema": "string",
  "table": "string",
  "column": "string",
  "path": "string",  //JSON fields only
  "dataType": "string",  //MongoDB, Amazon DynamoDB, and JSON fields only
  "metadata": {
    "presetId": "string",
    "generatorId": "SsnGenerator",
    "ratio": numeric,
    "isConsistent": boolean,
    "consistencyColumn": "string",
    "encryptionProcessor": "x-on", //To use configured Structural data encryption
    "customValueProcessor": "string"  //If custom value processor applied
  }
}
```

## Example replacement <a href="#generator-api-ssn-replacement" id="generator-api-ssn-replacement"></a>

In the following example replacement for the SSN generator, the generator is consistent with the `name` column.

None of the values are configured with dashes.

```json
{
  "name": "employee-number",
  "schema": "public",
  "table": "employees",
  "links": [
    {
      "schema": "public",
      "table": "employees",
      "column": "employee-number",
      "metadata": {
        "presetId": "SsnGenerator",
        "generatorId": "SsnGenerator",
        "ratio": 0,
        "isConsistent": true,
        "consistencyColumn": "name"
      }
    }
  ]
}
```
