shuffling

package
v0.6.4-1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PermuteIndex

func PermuteIndex(index ValidatorIndex, listSize uint64, seed Root) ValidatorIndex

PermuteIndex shuffles an individual list item without allocating a complete list. Returns the index in the would-be shuffled list.

func ShuffleList

func ShuffleList(input []ValidatorIndex, seed Root)

ShuffleList shuffles a list, using the given seed for randomness.

func UnpermuteIndex

func UnpermuteIndex(index ValidatorIndex, listSize uint64, seed Root) ValidatorIndex

UnpermuteIndex does the inverse of PermuteIndex, it returns the original index when given the same shuffling context parameters and permuted index.

func UnshuffleList

func UnshuffleList(input []ValidatorIndex, seed Root)

UnshuffleList undoes a list shuffling using the seed of the shuffling.

Types

This section is empty.

Jump to

Keyboard shortcuts

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