ql-qrng
v1.0.9
Published
test project
Downloads
26
Readme
const qrng = require("ql-qrng")
\
The utilization of Quantum Random Number Generator (QRNG) technology has the potential to transform various industries by providing an unparalleled level of security for transactions and data. QRNG employs photon detectors to generate random numbers, making it impossible to tamper with, as the outcome of any measurement of a quantum system is unpredictable. This unpredictability can be harnessed to produce genuinely random numbers.
\
QRNGs find crucial applications in areas such as cryptography, where genuinely random numbers are indispensable for safeguarding communication and encrypting data. Additionally, they are used in scientific research, simulations, and other sectors like banking, which necessitate the use of truly random numbers.
\
Using the NPM package, clients can extend the functionality of the random number generation service:
- hexadecimal(bits)
- decimal(bits)
- getQuantumHash(bits)
hexadecimal(bits)
- hexadecimal(bits): Clients encode their parameters in binary and send a message to the server using the MPM package, specifying the operation
"generate_hexadecimal"
. The server, subscribed to the"generate_hexadecimal"
channel, processes the binary parameters, generates the hexadecimal number, and sends it back to the client through the MPM infrastructure.
const otp = await qrng.hexadecimal(bits);
decimal(bits)
- decimal(bits): Clients craft a message with their binary parameters, indicating the operation
"generate_decimal"
, and transmit it to the server via the MPM package. Upon reception, the server interprets the binary parameters, performs the random decimal number generation, and returns the result to the client through the message-passing middleware.
const otp = await qrng.decimal(bits);
getQuantumHash(bits)
- getQuantumHash(bits): Clients construct a message containing their binary parameters and specify the operation
"get_quantum_hash"
. They then dispatch this message to the server through the MPM package. The server, having subscribed to the"get_quantum_hash"
channel, processes the binary parameters upon receipt, generates the quantum hash, and transmits it back to the client via the MPM system, ensuring the integrity and reliability of the communication channel.
const otp = await qrng.getQuantumHash(bits);
By leveraging the MPM package, these functionalities enhance the capabilities of the random number generation service provided by the REST API, enabling clients to seamlessly utilize additional features through efficient message passing between clients and the server.
Random Number Generation REST API
This REST API provides endpoints for generating random numbers in various formats. The API accepts parameters encoded in bits format, allowing you to request random numbers via HTTP interface.
Endpoints
1. qrngHex/
- Method:
GET
- Description: Generates a random hexadecimal number.
- Parameters:
- Bits Format
2. qrngDecimalNumber/
- Method:
GET
- Description: Generates a random decimal number.
- Parameters:
- Bits Format
3. qrngDecimalArray/
- Method:
GET
- Description: Generates an array of random decimal numbers.
- Parameters:
- Bits Format
4. qrngHexArray/
- Method:
GET
- Description: Generates an array of random hexadecimal numbers.
- Parameters:
- Bits Format
Usage
Random number generation through a REST API that accepts parameters through binary means that you can request random numbers via an HTTP interface, where the input parameters are encoded in binary format.
- qrngHex/
- This endpoint could be part of a quantum random number generator (QRNG) service, which generates random numbers based on quantum mechanical processes. Requesting from this endpoint likely returns a single random number in hexadecimal format. The parameters passed in binary could specify constraints or characteristics of the generated number, such as its range or precision.
- qrngDecimalNumber/
- This endpoint might generate a single random decimal number. The parameters provided in binary could influence the distribution of the generated number, such as its mean or standard deviation, or specify any constraints like minimum and maximum values.
- qrngDecimalArray/
- This endpoint could return an array of random decimal numbers. The binary parameters might dictate the size of the array and any additional characteristics of the generated numbers, similar to the previous endpoint.
- qrngHexArray/
- Similar to qrngDecimalArray, this endpoint would return an array of random hexadecimal numbers, with binary parameters specifying array size and other relevant factors.
In technical terms, clients would interact with these endpoints by sending HTTP requests, possibly using POST methods for more complex requests with binary data. The server-side implementation would parse the binary parameters, configure the quantum random number generation process accordingly, and respond with the requested random numbers in the specified format or structure, adhering to RESTful principles. Additionally, authentication and authorization mechanisms might be in place, especially for administrative functionalities, to ensure secure access and proper management of the system.
Happy Coding :)