rand

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package rand provides random addition chain generators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddsGenerator

type AddsGenerator struct {
	N int
}

AddsGenerator generates a random chain by making N random adds.

func (AddsGenerator) GenerateChain

func (a AddsGenerator) GenerateChain() (addchain.Chain, error)

GenerateChain generates a random chain based on N random adds.

func (AddsGenerator) String

func (a AddsGenerator) String() string

type Generator

type Generator interface {
	GenerateChain() (addchain.Chain, error)
	String() string
}

Generator can generate random chains.

type SolverGenerator

type SolverGenerator struct {
	N         uint
	Algorithm alg.ChainAlgorithm
	// contains filtered or unexported fields
}

SolverGenerator generates random N-bit values and uses an algorithm to build a chain for them.

func NewSolverGenerator

func NewSolverGenerator(n uint, a alg.ChainAlgorithm) SolverGenerator

NewSolverGenerator constructs a solver generator based on n-bit targets solved with a.

func (SolverGenerator) GenerateChain

func (s SolverGenerator) GenerateChain() (addchain.Chain, error)

GenerateChain generates a random n-bit value and builds a chain for it using the configured chain algorithm.

func (SolverGenerator) String

func (s SolverGenerator) String() string

Jump to

Keyboard shortcuts

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