Skip to content

Main content

Composite Key Collision Audit

Audit collisions introduced by naive delimiter-joined scalar composite keys, retaining distinct typed tuple witnesses instead of claiming safe serialization.

Loading tool…

Description

Audit collisions introduced by naive delimiter-joined scalar composite keys, retaining distinct typed tuple witnesses instead of claiming safe serialization.

An opaque key’s representation can affect equality and ordering even when its underlying value is unchanged. Delimiter joining can be ambiguous, fixed-width padding can preserve numeric order within agreed bounds, and typed length-prefix framing keeps scalar types distinct. Lengths in this family count UTF-16 code units unless a different unit is stated.

Audit collisions introduced by naive delimiter-joined scalar composite keys, retaining distinct typed tuple witnesses instead of claiming safe serialization.

When to use this tool

Use this tool to audit collisions introduced by naive delimiter-joined scalar composite keys, retaining distinct typed tuple witnesses instead of claiming safe serialization.

How to use the tool and how it works

  1. Enter tuplesJson, delimiter using the field definitions below. For JSON text, serialize the explicit records in the shown shape.
  2. Run the operation. Correct input errors before interpreting an output.
  3. Read result.collisions. Use the ordering, boundary rules and absence conditions described below.

Convert tuple scalars with ordinary string conversion and join with delimiter, then report joined keys shared by distinct JSON tuple spellings.1

Input fieldMeaning and unitsAccepted input
tuplesJsonJSON array of tuples. Each tuple is an array of scalar strings, finite numbers, booleans or null; nested arrays or objects inside a tuple are rejected.Text, at most 8,192 UTF-16 code units; the operation’s grammar also applies.
delimiterNonempty separator string; not an escape language.Text, at most 8,192 UTF-16 code units; the operation’s grammar also applies.

These are the decoded structures used in the example’s JSON text fields. Supply the corresponding serialized JSON strings as input.

json
{
  "tuplesJson": [
    [
      "a:b",
      "c"
    ],
    [
      "a",
      "b:c"
    ]
  ]
}
Output fieldInterpretation
resultObject containing the named fields below.
result.collisionsRepeated/colliding normalized or joined keys with original indexes.
json
{
  "input": {
    "tuplesJson": "[[\"a:b\",\"c\"],[\"a\",\"b:c\"]]",
    "delimiter": ":"
  },
  "output": {
    "result": {
      "collisions": [
        {
          "key": "a:b:c",
          "indexes": [
            0,
            1
          ]
        }
      ]
    }
  }
}

Limitations and assumptions

  • This deliberately exposes naive composite-key collisions rather than generating safe typed keys.
  • JSON numeric scalars use JavaScript floating-point numbers. Supply a JSON string when an identifier’s exact large-integer digits must be preserved; strings and numbers remain distinct scalar types.
  • String framing and alphabet digits use UTF-16 code units, not bytes or grapheme clusters. Exact integer text accepts a signed decimal spelling of at most 256 digits before operation-specific range checks.
  • Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
  • Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.

Alternative or Complementary methods

Use typed framing when distinct scalar types or tuple boundaries must remain distinguishable. Keep alphabet, width, normalization and numeric bounds consistent between producers and consumers.

References

  1. Tool behavior and example: Composite Key Collision Audit — tool.io

Similar or alternative tools

  • Opaque Key Affix Normalizer

    Ensure caller prefix and suffix are present after stripping/reapplying at most one matching affix; repeated inner affixes remain literal data, no recursive stripping or path semantics.

  • Opaque Key Alphabet Audit

    Audit opaque key UTF-16 code units against an explicit caller alphabet with positions; not Unicode grapheme, entropy or checksum validation.