crypto

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package crypto provides Node.js crypto module equivalents for transpiled TypeScript code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomBytes

func RandomBytes(n int) ([]byte, error)

RandomBytes generates n random bytes.

func RandomInt

func RandomInt(min, max int) int

RandomInt generates a random integer in [min, max).

func RandomUUID

func RandomUUID() string

RandomUUID generates a v4 UUID string.

Types

type Hash

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

Hash represents a streaming hash computation.

func CreateHash

func CreateHash(algorithm string) *Hash

CreateHash creates a new Hash with the given algorithm.

func CreateHmac

func CreateHmac(algorithm string, key []byte) *Hash

CreateHmac creates a new HMAC hash.

func (*Hash) Digest

func (h *Hash) Digest(encoding ...string) string

Digest finalizes and returns the hash as a hex string.

func (*Hash) Update

func (h *Hash) Update(data string) *Hash

Update adds data to the hash.

Jump to

Keyboard shortcuts

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