seed

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: ISC Imports: 2 Imported by: 0

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