# Exercises: Pseudo-Random Generator

Write a code to generate **30 pseudo-random integers** in the range **\[1...10]**, starting from certain **entropy**, taken as input, using **HMAC key derivation**.

From the **entropy** generate a **seed** (256-bit binary sequence) using **SHA-256**:

```python
seed = SHA256(entropy)
```

Generate the **n**-th random number by the formula:

```python
1 + HMAC-SHA256(n, seed) % 10
```

Print the numbers at the output, separated by space.

Sample **input** and corresponding **output**:

|             |                                                                   |
| ----------- | ----------------------------------------------------------------- |
| **Input**   | **Output**                                                        |
| hello       | 8 4 10 5 5 3 5 7 10 6 4 9 2 3 2 8 3 3 10 6 8 10 9 10 1 3 6 4 4 10 |
| random text | 10 5 5 9 7 4 2 9 2 1 10 4 8 9 8 1 8 6 5 7 5 4 3 4 6 6 9 8 1 1     |
| fun         | 6 5 9 2 2 5 1 6 10 10 10 1 8 10 6 9 2 1 5 10 1 4 8 5 6 3 8 4 2 1  |


---

# 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://cryptobook.nakov.com/secure-random-generators/exercises-pseudo-random-generator.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.
