passhashx

package
v0.0.0-...-7ee87ef Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const PASSHASH_VERSION = 1

Variables

View Source
var (
	ErrInvalidPassHash      = errors.New("invalid passhash")
	ErrUnknownAlgorithm     = errors.New("unknown algorithm")
	ErrHashMismatch         = errors.New("hash mismatch")
	ErrReadSaltFailed       = errors.New("read salt failed")
	ErrInvalidSecurityLevel = errors.New("invalid security level")
)

Functions

func Hash

func Hash(password []byte, sl SecurityLevel) ([]byte, error)

func HashBase64

func HashBase64(password []byte, sl SecurityLevel) (string, error)

func Verify

func Verify(password []byte, phash []byte) error

func VerifyBase64

func VerifyBase64(password []byte, phash string) error

Types

type SecurityLevel

type SecurityLevel int16
const (
	SecurityLevelHigh       SecurityLevel = 1
	SecurityLevelLow        SecurityLevel = 2
	SecurityLevelMobileHigh SecurityLevel = 3
	SecurityLevelMobileLow  SecurityLevel = 4
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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