Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixedInt ¶
FixedInt returns an integer in [0, n) that stays the same if the same hint is provided.
This fixed integer may change in different mieru versions.
This function uses an internal hint cache to accelerate look up.
func FixedIntPerHost ¶
FixedIntPerHost returns an integer in [0, n) that stays the same on the same host.
func FlipBits ¶
FlipBits modifies the input byte slice by changing some bits from 0 -> 1 or 1 -> 0.
The `src` must be either 0 or 1. When it is 0, some 0 bits will be changed to 1 bits. When it is 1, some 1 bits will be changed to 0 bits.
The `ratio` specifies the desired ratio of `src` bits in the byte slice after flip. The value must be within [0.0, 1.0]. When the input slice already has a smaller ratio, no flip is performed.
func IntRange64 ¶
IntRange64 returns a random int64 from [m, n) with scale down distribution.
Types ¶
This section is empty.