You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Note**: Offline mode provides reduced entropy diversity. For security-critical applications, consider using all available sources when network access is available.
150
150
151
151
152
+
## Direct vs Hybrid Mode
153
+
154
+
TrueEntropy offers two modes of operation to balance security and performance:
155
+
156
+
| Mode | Entropy Source | Performance | Use Case |
157
+
|------|---------------|-------------|----------|
158
+
|**DIRECT** (Default) | Directly from entropy pool | Slower, blocking | Cryptographic keys, wallets, severe security |
159
+
|**HYBRID**| PRNG seeded by pool | Extremely fast | Simulations, games, UI, general purpose |
160
+
161
+
### Using Hybrid Mode
162
+
163
+
Hybrid mode uses the TrueEntropy pool to periodically re-seed a fast pseudo-random number generator (PRNG). This provides the best of both worlds: the speed of standard Python random numbers with the entropy quality of our harvesters.
164
+
165
+
```python
166
+
import trueentropy
167
+
168
+
# Configure Hybrid Mode (re-seed every 60 seconds)
# The internal PRNG is automatically re-seeded from the entropy pool
174
+
for _ inrange(1000000):
175
+
val = trueentropy.random()
176
+
```
177
+
178
+
### Tuning Hybrid Mode
179
+
180
+
The `hybrid_reseed_interval` should be chosen based on your `offline_mode` setting:
181
+
182
+
***Online (Default)**: Network harvesters take time to collect entropy (latency). Set the interval to **10.0s or higher** to allow the pool to refill between reseeds.
183
+
***Offline (`offline_mode=True`)**: Local sources are near-instant. You can use lower intervals (e.g., **1.0s - 2.0s**) for frequent reseeding.
184
+
185
+
> **Tip**: If `health()` reports degraded status with low entropy bits, increase your reseed interval.
0 commit comments