sha256

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Unlicense Imports: 5 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

Len is the number of bytes in a sha256 hash.

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.

func (Hash) Based32String added in v0.1.13

func (h Hash) Based32String() string

Based32String returns the Basde32 encoded form of a SHA256 hash.

func (Hash) String added in v0.1.13

func (h Hash) String() string

String returns the hex encoded form of a SHA256 hash.

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