cryptoutil

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cryptoutil provides utility functions for cryptographic operations.

Index

Constants

View Source
const ErrDivisionByZero xerrors.Error = "division by zero; input must be greater than zero"

ErrDivisionByZero is returned when a division by zero is attempted.

Variables

This section is empty.

Functions

func RandomIndex added in v0.5.0

func RandomIndex(n int, randReader io.Reader) (int, error)

RandomIndex generates a cryptographically secure random index in the range [0, n-1]. It tries to eliminate bias by using the rejection method.

Types

This section is empty.

Jump to

Keyboard shortcuts

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