{
    "schemaVersion": "1.0.0",
    "publishedAt": "2026-08-05",
    "license": "CC0-1.0",
    "licenseUrl": "https://creativecommons.org/publicdomain/zero/1.0/",
    "purpose": "Deterministic offline QA for IMEI format and Luhn implementations.",
    "limitations": [
        "A Luhn-valid value is not proof that a device exists or that an identifier is assigned.",
        "No carrier, GSMA, manufacturer, blocklist, ownership, warranty or activation system is queried.",
        "Never send these synthetic fixtures to production identity, network or fraud systems."
    ],
    "contract": {
        "bodyLength": 14,
        "completeLength": 15,
        "characterSet": "ASCII digits 0-9 only",
        "normalization": "Remove whitespace, Unicode separator characters and ASCII hyphens before validating the numeric format.",
        "checkDigitPosition": 15,
        "algorithm": "Luhn mod 10",
        "fourteenDigitRule": "A 14-digit input is a completable body: formatValid=false, bodyFormatValid=true, completable=true, luhnValid=null and isValid=false. Completion is returned separately.",
        "deviceLookupIncluded": false
    },
    "validBodies": [
        {
            "body14": "49015420323751",
            "inputKind": "body",
            "bodyFormatValid": true,
            "completeImeiFormatValid": false,
            "completable": true,
            "luhnValid": null,
            "expectedCheckDigit": 8,
            "completedImei15": "490154203237518",
            "completedImeiFormatValid": true,
            "completedImeiLuhnValid": true,
            "deviceExistenceOrStatus": "not-checked",
            "trace": {
                "contributions": [
                    4,
                    9,
                    0,
                    2,
                    5,
                    8,
                    2,
                    0,
                    3,
                    4,
                    3,
                    5,
                    5,
                    2
                ],
                "sum": 52,
                "nextMultipleOfTen": 60
            }
        },
        {
            "body14": "12345678901234",
            "inputKind": "body",
            "bodyFormatValid": true,
            "completeImeiFormatValid": false,
            "completable": true,
            "luhnValid": null,
            "expectedCheckDigit": 7,
            "completedImei15": "123456789012347",
            "completedImeiFormatValid": true,
            "completedImeiLuhnValid": true,
            "deviceExistenceOrStatus": "not-checked",
            "trace": {
                "contributions": [
                    1,
                    4,
                    3,
                    8,
                    5,
                    3,
                    7,
                    7,
                    9,
                    0,
                    1,
                    4,
                    3,
                    8
                ],
                "sum": 63,
                "nextMultipleOfTen": 70
            }
        },
        {
            "body14": "00000000000000",
            "inputKind": "body",
            "bodyFormatValid": true,
            "completeImeiFormatValid": false,
            "completable": true,
            "luhnValid": null,
            "expectedCheckDigit": 0,
            "completedImei15": "000000000000000",
            "completedImeiFormatValid": true,
            "completedImeiLuhnValid": true,
            "deviceExistenceOrStatus": "not-checked",
            "trace": {
                "contributions": [
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0,
                    0
                ],
                "sum": 0,
                "nextMultipleOfTen": 0
            }
        },
        {
            "body14": "99999999999999",
            "inputKind": "body",
            "bodyFormatValid": true,
            "completeImeiFormatValid": false,
            "completable": true,
            "luhnValid": null,
            "expectedCheckDigit": 4,
            "completedImei15": "999999999999994",
            "completedImeiFormatValid": true,
            "completedImeiLuhnValid": true,
            "deviceExistenceOrStatus": "not-checked",
            "trace": {
                "contributions": [
                    9,
                    9,
                    9,
                    9,
                    9,
                    9,
                    9,
                    9,
                    9,
                    9,
                    9,
                    9,
                    9,
                    9
                ],
                "sum": 126,
                "nextMultipleOfTen": 130
            }
        }
    ],
    "validationCases": [
        {
            "input": "490154203237518",
            "expectedInputKind": "imei",
            "expectedFormatValid": true,
            "expectedBodyFormatValid": false,
            "expectedCompletable": false,
            "expectedCompletedImei": null,
            "expectedLuhnValid": true,
            "expectedIsValid": true,
            "reason": "15 ASCII digits with the expected Luhn check digit."
        },
        {
            "input": "490154203237519",
            "expectedInputKind": "imei",
            "expectedFormatValid": true,
            "expectedBodyFormatValid": false,
            "expectedCompletable": false,
            "expectedCompletedImei": null,
            "expectedLuhnValid": false,
            "expectedIsValid": false,
            "reason": "The final digit does not match the Luhn calculation."
        },
        {
            "input": "49015420323751",
            "expectedInputKind": "body",
            "expectedFormatValid": false,
            "expectedBodyFormatValid": true,
            "expectedCompletable": true,
            "expectedCompletedImei": "490154203237518",
            "expectedCheckDigit": 8,
            "expectedLuhnValid": null,
            "expectedIsValid": false,
            "reason": "A 14-digit body can be completed, but it is not yet a complete IMEI."
        },
        {
            "input": "49015420A237518",
            "expectedInputKind": "invalid",
            "expectedFormatValid": false,
            "expectedBodyFormatValid": false,
            "expectedCompletable": false,
            "expectedCompletedImei": null,
            "expectedLuhnValid": null,
            "expectedIsValid": false,
            "reason": "Non-digit characters are outside the IMEI format."
        },
        {
            "input": " 490154203237518 ",
            "normalizedInput": "490154203237518",
            "expectedInputKind": "imei",
            "expectedFormatValid": true,
            "expectedBodyFormatValid": false,
            "expectedCompletable": false,
            "expectedCompletedImei": null,
            "expectedLuhnValid": true,
            "expectedIsValid": true,
            "reason": "The Random IMEI contract removes whitespace, Unicode separators and ASCII hyphens before validating the numeric format."
        },
        {
            "input": "35 8240 11 3456784",
            "normalizedInput": "358240113456784",
            "expectedInputKind": "imei",
            "expectedFormatValid": true,
            "expectedBodyFormatValid": false,
            "expectedCompletable": false,
            "expectedCompletedImei": null,
            "expectedLuhnValid": true,
            "expectedIsValid": true,
            "reason": "Unicode non-breaking spaces are normalized consistently by the PHP and JavaScript validators."
        },
        {
            "input": "000000000000000",
            "expectedInputKind": "imei",
            "expectedFormatValid": true,
            "expectedBodyFormatValid": false,
            "expectedCompletable": false,
            "expectedCompletedImei": null,
            "expectedLuhnValid": true,
            "expectedIsValid": true,
            "reason": "Useful edge case: it passes the arithmetic but must never be interpreted as a real or assigned device identifier."
        }
    ],
    "primaryReferences": [
        "https://www.gsma.com/get-involved/working-groups/terminal-steering-group/imei-database/",
        "https://www.gsma.com/get-involved/working-groups/gsma_resources/ts-06/"
    ]
}