# Randomly

**Randomly** is a powerful randomization and generation toolkit for Unity, designed for procedural content, gameplay systems, testing, and editor workflows in real production projects.

***

### <mark style="color:$success;">Seed</mark>

* `SetSeed(int seed)` – Set a fixed seed for deterministic random generation.
* `SetRandomSeed()` – Generates a new seed from a cryptographically secure RNG.

***

### <mark style="color:$success;">Generate</mark>

* `Byte() / Byte(byte max) / Byte(byte min, byte max)` – Generate random byte values.
* `Short() / Short(short max) / Short(short min, short max)` – Generate random shorts.
* `Int() / Int(int max) / Int(int min, int max)` – Generate random integers.
* `Float() / Float(float max) / Float(float min, float max)` – Generate random floats.
* `Double() / Double(double max) / Double(double min, double max)` – Generate random double.
* `Bool() / Bool(float chance)` – Generate random boolean values, optionally with a probability to be true.

***

### <mark style="color:$warning;">**Important**</mark>

Randomly uses the **Xoshiro256**\*\* algorithm and always includes the maximum value.

***

{% code title="Example.cs" %}

```csharp
using PahutyakV.Randomly;

// Random int value
int i = Randomly.Int(0, 2);

// Random bool value with a probability to be true (0-1)
bool b = Randomly.Bool(0.75f);
```

{% endcode %}
