REST API that validates if values are strings.
payload:
{
"values": [
"1",
"2",
"3",
"1000001"
]
}
works as health path. doesn't require validation
- PORT: port where the app will run, default:
8080
- MAX_LEN: maximum quantity of digits of the numbers to test, default:
200
- SECRET_HEADER: header to validate the requests, default:
Secret
- SECRET: secret_header value to validate the request, default:
SecretStringExample1111000011110000
return the numbers as keys and the result as value:
(1)key: (2)value
- an input value
- if it's prime ("Yes", "No", "Probably")
The Json can have at most 20 values.
{
"values": [
"1",
"2",
"3"
]
}
{
"1": "No",
"2": "Yes",
"3": "Yes"
}
if the result is Probably
it means that it passed 64 iterations
of Miller Rabin primality test.
The probability of the number not being a prime is