Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Argon2id defines the argon2i hashing algorithm Argon2id = Algorithm(0x01) // Pbkdf2HmacSha512 defines pbkdf2+hmac-sha512 hashing algorithm Pbkdf2HmacSha512 = Algorithm(0x02) // Scrypt defines scrypt hashing algorithm Scrypt = Algorithm(0x03) )
Variables ¶
View Source
var Strategies = map[Algorithm]func(func() []byte) Strategy{ Argon2id: func(salt func() []byte) Strategy { s, _ := newArgon2Deriver(salt(), argon2.IDKey) return s }, Scrypt: func(salt func() []byte) Strategy { s, _ := newScryptDeriver(salt()) return s }, Pbkdf2HmacSha512: func(salt func() []byte) Strategy { s, _ := newPbkdf2Deriver(sha512.New, salt(), pbkdf2Iterations, sha512.Size) return s }, }
Strategies defines available hashing strategies
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶ added in v1.0.2
type Algorithm uint8
Algorithm is the password hashing strategy code
type Metadata ¶ added in v1.0.2
type Metadata struct { Algorithm uint8 `cbor:"1,keyasint"` Version uint8 `cbor:"2,keyasint"` Salt []byte `cbor:"3,keyasint"` Hash []byte `cbor:"4,keyasint"` // contains filtered or unexported fields }
Metadata represents hasher result
Click to show internal directories.
Click to hide internal directories.