entropy

package module
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MPL-2.0 Imports: 1 Imported by: 4

README

Entropy Package

This package is split into its own Go module so that importers just wanting entropy do not need the full set of dependencies used by the main module.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewMockRandomReader

func NewMockRandomReader() *Reader

provide a mock entropy.Reader

func NewReader

func NewReader(source Sourcer) *Reader

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

Read reads exactly len(p) bytes from r into p. If r returns an error having read at least len(p) bytes, the error is dropped. It returns the number of bytes copied and an error if fewer bytes were read. On return, n == len(p) if and only if err == nil.

type Sourcer

type Sourcer interface {
	GetRandom(bytes int) ([]byte, error)
}

Jump to

Keyboard shortcuts

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