RandomFork

package
v0.0.0-...-993cbae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Binomial

func Binomial(n uint64, k uint64) uint64

function for calculating n choose k - n over k

func Decode

func Decode(numOfSetBits uint64, ordinal uint64) uint64

decodes ordinal number numOfSetBits - number of bits that have to be 1 ordinal - number that is being decoded. ordinal goes from 0 to (n over numOfSetBits)-1

func DecodeToPositions

func DecodeToPositions(numOfSetBits uint64, ordinal uint64) []uint8

decodes ordinal number to array of position of set bits from rightmost to leftmost set bit. e.g. 1011 will return 0 1 3 numOfSetBits - number of bits that have to be 1 ordinal - number that is being decoded. ordinal goes from 0 to (n over numOfSetBits)-1

func ForkBits

func ForkBits(forkbits []uint8, value uint64) uint64

applies fork with numOfSetBits bits of 1 to the given value

func ForkNumber

func ForkNumber(fork uint64, value uint64, numOfSetBits uint64) uint64

applies fork with numOfSetBits bits of 1 to the given value

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL