sha

package
v0.3.22 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: MIT Imports: 11 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(algType types.Type, config *types.Config) (interfaces.Cryptographic, error)

NewSHA creates a new SHA crypto instance

func NewSha1 added in v0.3.18

func NewSha1(config *types.Config) (interfaces.Cryptographic, error)

func NewSha224 added in v0.3.18

func NewSha224(config *types.Config) (interfaces.Cryptographic, error)

func NewSha256 added in v0.3.18

func NewSha256(config *types.Config) (interfaces.Cryptographic, error)

func NewSha3224

func NewSha3224(config *types.Config) (interfaces.Cryptographic, error)

func NewSha3256

func NewSha3256(config *types.Config) (interfaces.Cryptographic, error)

func NewSha3384 added in v0.3.18

func NewSha3384(config *types.Config) (interfaces.Cryptographic, error)

func NewSha3512

func NewSha3512(config *types.Config) (interfaces.Cryptographic, error)

func NewSha3512224

func NewSha3512224(config *types.Config) (interfaces.Cryptographic, error)

func NewSha3512256

func NewSha3512256(config *types.Config) (interfaces.Cryptographic, error)

func NewSha384 added in v0.3.18

func NewSha384(config *types.Config) (interfaces.Cryptographic, error)

func NewSha512 added in v0.3.18

func NewSha512(config *types.Config) (interfaces.Cryptographic, error)

func ResolveType added in v0.3.18

func ResolveType(algType types.Type) (types.Type, error)

ResolveType resolves the Type 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 Scrypt algorithm

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) 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) Type

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

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