hashing

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandSalt

func GetRandSalt(saltLen int) ([]byte, error)

func HashPermissionPasswords

func HashPermissionPasswords(perms map[string]string, argonSettings ArgonSettings) (map[string]HashedPassword, error)

func SaltFromHex

func SaltFromHex(hexString string) ([]byte, error)

Types

type ArgonSettings added in v0.0.3

type ArgonSettings struct {
	ArgonTime     uint32 `json:"argon_time"`
	ArgonMemory   uint32 `json:"argon_memory"`
	ArgonThreads  uint8  `json:"argon_threads"`
	ArgonHashSize uint32 `json:"argon_hash_size"`
}

func NewArgonDefaultSettings added in v0.0.3

func NewArgonDefaultSettings() ArgonSettings

func NewArgonSettings added in v0.0.3

func NewArgonSettings(argonTime uint32, argonMemory uint32, argonThreads uint8, argonHashSize uint32) ArgonSettings

type HashedPassword

type HashedPassword struct {
	Hash []byte `json:"hash"`
	Salt []byte `json:"salt"`
	ArgonSettings
}

func GetHashedPassword

func GetHashedPassword(password string, salt []byte, argonSettings ArgonSettings) HashedPassword

Jump to

Keyboard shortcuts

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