seed

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: ISC Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// The Default length in bytes for a seed
	DefaultSeedBytes = 32 // 256 bits

	// MinSeedBytes is the minimum number of bytes allowed for a seed
	MinSeedBytes = 16 // 128 bits

	// MaxSeedBytes is the maximum number of bytes allowed for a seed
	MaxSeedBytes = 256 // 1024 bits
)

Variables

View Source
var (
	// ErrInvalidSeedLen describes an error in which the provided seed or
	// seed length is not in the allowed range.
	ErrInvalidSeedLen = fmt.Errorf("seed length must be between %d and %d "+
		"bits", MinSeedBytes*8, MaxSeedBytes*8)
)

Functions

func GenerateSeed

func GenerateSeed(length uint16) ([]byte, error)

GenerateSeed returns a cryptographically secure random seed that can be used as the input for the further usage.

The length is in bytes and it must be between 16 and 256 (128 to 1024 bits). The default length is 32 (256 bits) as defined by the DefaultSeedLength constant.

Types

This section is empty.

Jump to

Keyboard shortcuts

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