CNH generator and validator
Generate valid CNH numbers to use in tests or check whether a CNH is valid.
A valid CNH is generated when the page opens. Choose the quantity or click "Generate CNH" to create another one.
How it works
- The CNH is generated on the server and is not stored anywhere.
- The generated number is the 11-digit registration number, the one systems ask for.
- The two check digits follow the Denatran rule.
- The number is for testing only and does not belong to any real person.
- The latest generated values are listed below the button until you leave the page.
How to use the API
You can integrate the CNH generator into your app through our REST API.
Endpoint
GET /api/generators/cnh
Query parameters
- quantity
- Optional. From 1 to 50. When set, the response has the "cnhs" list instead of "cnh".
curl example
curl "https://devtools.vmotta.dev/api/generators/cnh?quantity=2"
Response
{
"cnhs": [
"25755879684",
"61360956403"
]
}Enter the CNH registration number and click "Validate CNH" to find out whether it is valid.
How it works
- Validation runs on the server and nothing is stored.
- The 11 digits and the two check digits are verified.
- The registration number is in the "Nº Registro" field of the CNH.
- The result shows up right below the field.
How to use the API
You can integrate the CNH validator into your app through our REST API.
Endpoint
POST /api/validators/cnh
Request body
- cnh
- Required. The 11 digits of the registration number.
curl example
curl -X POST https://devtools.vmotta.dev/api/validators/cnh \
-H "Content-Type: application/json" \
-d '{"cnh":"61173562148"}'Example body
{
"cnh": "61173562148"
}Response
{
"isValid": true
}