v1 source pure
Entropy generates fully deterministic, cost-effective, and hard to guess numbers.
View source
gno.land/p/moul/entropy/v1
A cheap, deterministic pseudo-entropy source for gno realms (seeded from block height / time / caller), useful for demos and non-security-critical randomness.
Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
⚠️ Disclaimer: provided as-is, without warranty; not security-audited. Full disclaimer: DISCLAIMER.
Entropy generates fully deterministic, cost-effective, and hard to guess numbers.
It is designed both for single-usage, like seeding math/rand or for being reused which increases the entropy and its cost effectiveness.
Disclaimer: this package is unsafe and won't prevent others to guess values in advance.
It uses the Bernstein's hash djb2 to be CPU-cycle efficient.
2
1
type Instance
struct4
- chain/runtime stdlib
- chain/runtime/unsafe stdlib
- math stdlib
- time stdlib