sha

package
v1.3.1 Latest Latest
Warning

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

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

Documentation

Overview

Package sha implements the functions, types, and interfaces for the module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *types.Config

func NewSHA added in v0.3.18

func NewSHA(algSpec types.Spec, config *types.Config) (scheme.Scheme, error)

NewSHA creates a new SHA crypto instance

func NewSha1 added in v0.3.18

func NewSha1(config *types.Config) (scheme.Scheme, error)

func NewSha224 added in v0.3.18

func NewSha224(config *types.Config) (scheme.Scheme, error)

func NewSha256 added in v0.3.18

func NewSha256(config *types.Config) (scheme.Scheme, error)

func NewSha3224

func NewSha3224(config *types.Config) (scheme.Scheme, error)

func NewSha3256

func NewSha3256(config *types.Config) (scheme.Scheme, error)

func NewSha3384 added in v0.3.18

func NewSha3384(config *types.Config) (scheme.Scheme, error)

func NewSha3512

func NewSha3512(config *types.Config) (scheme.Scheme, error)

func NewSha3512224

func NewSha3512224(config *types.Config) (scheme.Scheme, error)

func NewSha3512256

func NewSha3512256(config *types.Config) (scheme.Scheme, error)

func NewSha384 added in v0.3.18

func NewSha384(config *types.Config) (scheme.Scheme, error)

func NewSha512 added in v0.3.18

func NewSha512(config *types.Config) (scheme.Scheme, error)

func ResolveSpec added in v1.1.0

func ResolveSpec(algSpec types.Spec) (types.Spec, error)

ResolveSpec resolves the Spec for PBKDF2, providing a default underlying hash if not specified.

Types

type Params added in v0.3.18

type Params struct {
}

Params represents parameters for SHA algorithms

func DefaultParams added in v0.3.18

func DefaultParams() *Params

func FromParams added in v0.3.18

func FromParams(m map[string]string) (params *Params, err error)

FromParams parses Scrypt parameters from a map[string]string.

func (*Params) FromMap added in v0.3.18

func (p *Params) FromMap(params map[string]string) error

func (*Params) IsNil added in v1.1.0

func (p *Params) IsNil() bool

func (*Params) String added in v0.3.18

func (p *Params) String() string

String returns the string representation of parameters

func (*Params) ToMap added in v0.3.18

func (p *Params) ToMap() map[string]string

ToMap converts Params to a map[string]string

func (*Params) Validate added in v0.3.18

func (p *Params) Validate(config *types.Config) error

type SHA

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

SHA implements the SHA hashing algorithm

func (*SHA) Hash

func (c *SHA) Hash(password string) (*types.HashParts, error)

Hash implements the hash method

func (*SHA) HashWithSalt

func (c *SHA) HashWithSalt(password string, salt []byte) (*types.HashParts, error)

HashWithSalt implements the hash with salt method

func (*SHA) Spec added in v1.1.0

func (c *SHA) Spec() types.Spec

func (*SHA) Verify

func (c *SHA) Verify(parts *types.HashParts, password string) error

Verify implements the verify method

Jump to

Keyboard shortcuts

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