sha256

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Unlicense Imports: 3 Imported by: 0

Documentation

Overview

Package sha256 provides a simple interface for single and double SHA256 hashes, used with secp256k1 signatures, message digest checksums, cloaked public key "addresses" and so on.

Index

Constants

View Source
const (
	Len = 32
)

Variables

This section is empty.

Functions

func Zero

func Zero(h Hash)

Zero copies a cleanly initialised empty slice over top of the provided Hash.

Types

type Hash

type Hash [32]byte

Hash is just a 256-bit hash.

func Double

func Double(b []byte) Hash

Double runs a standard double SHA256 hash and does all the slicing for you.

func New

func New() Hash

New creates a correctly sized slice for a Hash.

func Single

func Single(b []byte) Hash

Single runs a standard SHA256 hash and does all the slicing for you.

func (Hash) Zero

func (h Hash) Zero()

Zero out the values in the hash. Hashes can be used as secrets.

Jump to

Keyboard shortcuts

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