encrypt

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const HashtypeBcrypt = "bcrypt"

HashtypeBcrypt is Hashtype bcrypt

View Source
const HashtypeScrypt = "scrypt"

HashtypeScrypt is Hashtype scrypt

View Source
const SaltBufLen = 14

SaltBufLen is Salt buffer length

View Source
const WrongPasswordMessage = "Wrong Password"

WrongPasswordMessage is error message

Variables

This section is empty.

Functions

This section is empty.

Types

type DataHash

type DataHash struct {
}

DataHash struct

func (DataHash) GetHash

func (dh DataHash) GetHash(data string) string

GetHash get hashed data

type PasswordHash

type PasswordHash struct {
	Type         string
	ScryptN      int
	ScryptR      int
	ScryptP      int
	ScryptKeylen int
}

PasswordHash struct

func (PasswordHash) Compare

func (ph PasswordHash) Compare(hashedpassword, password, saltstr string) error

Compare compares hashed password and string password

func (PasswordHash) GetHashed

func (ph PasswordHash) GetHashed(password string) (string, string, error)

GetHashed get hashed password and salt

Jump to

Keyboard shortcuts

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