True Random Supply API

APIに関する概要と想定される用途や乱数発生源に関する情報が入る。

Example REST Requests

Release Note

  • v1 First Version

About This API

Version: 1.0.0
BasePath: /v1
Copyright © National Institute of Information and Communications Technology. All Rights Reserved.

API Document

Methods

[ Jump to Models ]
GET /v1/base64
Gets True Random Number in Base64. Optional query param of size determines size of the random Number is not a length of the returned string.

Usage Sample

curl -X GET https://trnd.nict.go.jp/v1/base64?size=

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Query parameters

size (optional)
Query Parameter — Size of random number format: int32

Return type

Example data

Content-Type: application/json
{
  "size" : "16",
  "format" : "base64",
  "body" : "/2BuBuLf3+WfSKyQbRcc/A=="
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Successful response Random

XXX

unexpected error Error
GET /v1/bytes
Gets True Random Number in Bytes. Optional query param of size determines a length of the returned string.

Usage Sample

curl -X GET https://trnd.nict.go.jp/v1/bytes?size=

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Query parameters

size (optional)
Query Parameter — Size of random number format: int32

Return type

Example data

Content-Type: application/json
{
  "size" : "16",
  "format" : "bytes",
  "body" : "\xD8\\\xE0\xF4\r\xB2\xFC*WM\xFF\x83\x18\xF45\xB6"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Successful response Random

XXX

unexpected error Error
GET /v1/hex
Gets True Random Number in Hex. Optional query param of size determines size of the random Number is not a length of the returned string.

Usage Sample

curl -X GET https://trnd.nict.go.jp/v1/hex?size=

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Query parameters

size (optional)
Query Parameter — Size of random number format: int32

Return type

Example data

Content-Type: application/json
{
  "size" : "16",
  "format" : "hex",
  "body" : "eb693ec8252cd630102fd0d0fb7c3485"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Successful response Random

XXX

unexpected error Error
GET /v1/number
Gets True Random Number in Number. If optional query param of size is given, it returns an integer: 0 <= Random Number <= size. If size is not given or 0 is given, it returns a float: 0.0 <= Random Number < 1.0.

Usage Sample

curl -X GET https://trnd.nict.go.jp/v1/number?size=

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Query parameters

size (optional)
Query Parameter — Size of random number format: int32

Return type

Example data

Content-Type: application/json
{
  "size" : "0",
  "format" : "number",
  "body" : "0.596506046187744"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Successful response Random

XXX

unexpected error Error

Models

[ Jump to Methods ]

Error -

code
Integer format: int32
message

Random -

body (optional)
String Returned True Random Number
format (optional)
String Format of the returned True Random Number
size (optional)
String Size of the returned True Random Number