# ASCII Key (AsciiPkGenerator)

The [ASCII Key](https://docs.tonic.ai/app/generation/generators/generator-reference/ascii-key) generator can be applied to primary key columns. It generates unique alphanumeric strings based on any printable ASCII characters.

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

The ASCII Key generator can be configured to be self-consistent, but not consistent with another column. You cannot configure differential privacy.

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

There is no generator-specific configuration.

<pre class="language-json"><code class="lang-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": "AsciiPkGenerator",
    "excludeLowercaseAlphabet": boolean,
<strong>    "isConsistent": boolean,
</strong>    "encryptionProcessor": "x-on", //To use configured Structural data encryption
    "customValueProcessor": "string"   //If custom value processor applied
  }
}
</code></pre>

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

In the following example replacement for the ASCII Key generator, consistency is disabled. The output values do not include lowercase letters.

```json
{
  "name": "userid",
  "schema": "test",
  "table": "users",
  "links": [
    {
      "schema": "test",
      "table": "users",
      "column": "userid",
      "metadata": {
        "presetId": "AsciiPkGenerator",
        "generatorId": "AsciiPkGenerator",
        "excludeLowercaseAlphabet": true,
        "isConsistent": false
      }
    }
  ]
}
```
