# Rand

[spec](https://www.cryptopp.com/wiki/RandomNumberGenerator)

## How to ???

```python
#!/usr/bin/env python

import requests
import json
import os,binascii

def sending(message):
    url = 'http://127.0.0.1:6613/'
    response=requests.post(url, data=message)
    print response.content

data_js='{"version":1,"algorithm":"RAND_RP","length":12}'
sending(data_js)
```

In this example we generate 12 random bytes with RAND\_RP algorithm without entropy.

* On *data\_js\["algorithm"]* can be one of *{RAND\_RP, RAND\_AUTO, RAND\_RDRAND}*

To add entropy we need to the parameter *"entropy": INT*

* 0 means with entropy using /dev/urandom
* 1 means with entropy using /dev/random
* 2 means without entropy

Json to rand

```javascript
{"version":1,"algorithm":"rand flavor","length":INT ,"entropy":INT}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://coherence.3vidence.com/rand.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
