Skip to content
Lattice

HederaPrngAdapterLib

Git Source

Title: HederaPrngAdapterLib

Authors: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80), Modified from hiero-ledger/hiero-contracts (https://github.com/hiero-ledger/hiero-contracts)

Stateless wrapper around the PRNG system contract; drawInRange mirrors the upstream helper's modulo reduction (bias is negligible for ranges far below 2^32 but is NOT uniform in general).

Functions

__HederaPrngAdapter_init

function __HederaPrngAdapter_init() internal;

registerInterface

function registerInterface() internal;

drawSeed

function drawSeed() internal returns (bytes32 seed);

Returns

NameTypeDescription
seedbytes32

drawInRange

function drawInRange(uint32 lo, uint32 hi) internal returns (uint32 number);

Parameters

NameTypeDescription
louint32
hiuint32

Returns

NameTypeDescription
numberuint32