Entropy Sector API is intended to make SwiftRNG true randomness available to your application using RESTful API. The following describes how to use the API to retrieve true random numbers (or bytes) or to generate random sequences of unique integer numbers.
A functional React-based live demo that uses this API is available here here, and its source code is available here.
Retrieve random bytes (public access)
-
URL
/api/v1/public/bytes/:count
-
Method:
GET
-
URL Params
Required:
count=[integer]
Valid values: between 1 and 400
Description: amount of bytes to retrieve -
Success Response:
Code: 200
Content type:application/octet-stream
Content:random bytes
-
Error Response:
Code: 400
Content type:application/octet-stream
Content:error message
-
Sample Request:
https://entropysector.com/hwrng/api/v1/public/bytes/200
-
Notes:
It does not require user authentication
Retrieve random bytes (complete access)
-
URL
/api/v1/bytes/:count
-
Method:
GET
-
URL Params
Required:
count=[integer]
Valid values: between 1 and 100000
Description: amount of bytes to retrieve -
HTTP request headers
Required:
tl-ent-sce-auth-token
Description: user authentication token to access the resourceOptional:
tl_req_hash_challenge
Description: user defined text used as salt for generating a SHA256 value of the HTTP response random bytesOptional:
tl-ent-sce-crypto-token
Description: Crypto token to secure the byte stream -
HTTP response headers
Required:
tl-resp-bytehash
Description: a SHA256 value of the original (unencrypted) byte stream response -
Success Response:
Code: 200
Content type:application/octet-stream
Content:random bytes
-
Error Responses:
Code: 400
Content type:application/octet-stream
Content:error message
Code: 403
Content type:application/octet-stream
Content:Insufficient permissions to perform requested action.
-
Sample Request:
https://entropysector.com/hwrng/api/v1/bytes/20000
-
Notes:
It requires a user authentication token. Contact us to receive a beta authentication token
Retrieve random numbers (public access)
-
URL
/api/v1/public/numbers/:count
-
Method:
GET
-
URL Params
Required:
count=[integer]
Valid values: between 1 and 100
Description: amount of numbers to retrieve -
Success Response:
Code: 200
Content type:application/json
Content:{"data":[-443826749,-1265738728],"status":"success","message":""}
Valid values: each random number is an integer value between -2,147,483,648 and 2,147,483,647 -
Error Response:
Code: 200
Content type:application/json
Content:{"data":[],"status":"error","message":"Error message"}
-
Sample Request:
https://entropysector.com/hwrng/api/v1/public/numbers/10
-
Notes:
It does not require user authentication
Retrieve random numbers (complete access)
-
URL
/api/v1/numbers/:count
-
Method:
GET
-
URL Params
Required:
count=[integer]
Valid values: between 1 and 25000
Description: amount of numbers to retrieve -
HTTP request headers
Required:
tl-ent-sce-auth-token
Description: user authentication token to access the resource -
Success Response:
Code: 200
Content type:application/json
Content:{"data":[-443826749,-1265738728],"status":"success","message":""}
Valid values: each random number is an integer value between -2,147,483,648 and 2,147,483,647 -
Error Response:
Code: 200
Content type:application/json
Content:{"data":[],"status":"error","message":"Error message"}
Code: 403
Content type:application/json
Content:Insufficient permissions to perform requested action.
-
Sample Request:
https://entropysector.com/hwrng/api/v1/numbers/1000
-
Notes:
It requires a user authentication token. Contact us to receive a beta authentication token
Retrieve random sequences of unique integer numbers (public access)
-
URL
/api/v1/public/sequence/unique/numbers/:minNumber/:maxNumber/:limit
-
Method:
GET
-
URL Params
Required:
minNumber=[integer]
Valid values: between -100000000 and 100000000
Description: the smallest number in the rangeRequired:
maxNumber=[integer]
Valid values: between -100000000 and 100000000
Description: the largest number in the rangeRequired:
limit=[integer]
Valid values: between 1 and 10
Description: how many numbers to include in sequence -
Success Response:
Code: 200
Content type:application/json
Content:{"data":[2,62,38,64,46],"status":"success","message":""}
-
Error Response:
Code: 200
Content type:application/json
Content:{"data":[],"status":"error","message":"Error message"}
-
Sample Request:
https://entropysector.com/hwrng/api/v1/public/sequence/unique/numbers/1/69/5
-
Notes:
It does not require user authentication
Retrieve random sequences of unique integer numbers (complete access)
-
URL
/api/v1/sequence/unique/numbers/:minNumber/:maxNumber/:limit
-
Method:
GET
-
URL Params
Required:
minNumber=[integer]
Valid values: between -100000000 and 100000000
Description: the smallest number in the rangeRequired:
maxNumber=[integer]
Valid values: between -100000000 and 100000000
Description: the largest number in the rangeRequired:
limit=[integer]
Valid values: between 1 and 1000
Description: how many numbers to include in sequence -
HTTP request headers
Required:
tl-ent-sce-auth-token
Description: user authentication token to access the resource -
Success Response:
Code: 200
Content type:application/json
Content:{"data":[2,62,38,64,46],"status":"success","message":""}
-
Error Response:
Code: 200
Content type:application/json
Content:{"data":[],"status":"error","message":"Error message"}
Code: 403
Content type:application/json
Content:Insufficient permissions to perform requested action.
-
Sample Request:
https://entropysector.com/hwrng/api/v1/sequence/unique/numbers/-100/20000/100
-
Notes:
It requires a user authentication token. Contact us to receive a beta authentication token