Documentation ¶
Index ¶
- func Clamp(value, min, max int64) int64
- func ClampCookieAge(seconds int64) int64
- func DirSize(dirPath string) (int64, error)
- func ExtractPDF()
- func FileSize(filePath string) (int64, error)
- func IsValidPassword(password string) bool
- func IsValidSessionName(sessionName *string) bool
- func IsValidUsername(username string) bool
- func PathExists(pathTo string) bool
- func PeriodicTask(d time.Duration, f func())
- func ReadJSON(jsonFile string) ([]byte, error)
- func Similarity(a string, b string) float64
- func UniversalExtract(dst string, archivePath string) ([]string, int)
- type Argon2idHash
- type HashSalt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClampCookieAge ¶ added in v0.7.2
ClampCookieAge returns a valid cookie age in seconds.
func ExtractPDF ¶ added in v0.7.0
func ExtractPDF()
func IsValidPassword ¶ added in v0.7.2
IsValidPassword checks if the password is valid.
func IsValidSessionName ¶ added in v0.7.2
IsValidSessionName checks if the session name is valid.
func IsValidUsername ¶ added in v0.7.2
IsValidUsername checks if the username is valid.
func PathExists ¶ added in v0.7.0
PathExists checks if the given path exists.
func PeriodicTask ¶
PeriodicTask loops the given function in separate thread between the given interval.
func Similarity ¶ added in v0.7.0
Similarity calculates the similarity between two strings.
Types ¶
type Argon2idHash ¶ added in v0.7.2
type Argon2idHash struct {
// contains filtered or unexported fields
}
Argon2idHash is a wrapper for the argon2id hashing algorithm. https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#password-hashing-algorithms
func DefaultArgon2idHash ¶ added in v0.7.2
func DefaultArgon2idHash() *Argon2idHash
DefaultArgon2idHash constructor function for Argon2idHash. https://tobtu.com/minimum-password-settings/
func NewArgon2idHash ¶ added in v0.7.2
func NewArgon2idHash(time, saltLen, memory uint32, threads uint8, keyLen uint32) *Argon2idHash
NewArgon2idHash constructor function for Argon2idHash.
func (*Argon2idHash) Compare ¶ added in v0.7.2
func (a *Argon2idHash) Compare(hash, salt, password []byte) bool
Compare generated hash with stored hash.
func (*Argon2idHash) GenerateHash ¶ added in v0.7.2
func (a *Argon2idHash) GenerateHash(password, salt []byte) (*HashSalt, error)
GenerateHash using the password and provided salt. If no salt value was provided, fallbacks to a random value of a given length.