ofsbcrypt

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

module designed to define a BCrypt hasher that can be used with the Osgood File Server's Authenticators. this will fit the Hasher interface defined in ofsauthenticators/interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BCryptHasher

type BCryptHasher struct {
	// contains filtered or unexported fields
}

func NewBCryptHasher

func NewBCryptHasher(opts ...BCryptHasherOptFunc) (hasher *BCryptHasher, err error)

function designed to create, initialize and return a BCryptHasher object.

func (*BCryptHasher) ComparePassHash

func (bch *BCryptHasher) ComparePassHash(password []byte, hash []byte) error

function designed to take in a password and hash and compare the two.

if the password and hash match, nil will be returned.

func (*BCryptHasher) HashPassword

func (bch *BCryptHasher) HashPassword(password []byte) (hash []byte, err error)

function designed to calculate and return the hash of a given password.

type BCryptHasherOptFunc

type BCryptHasherOptFunc func(*BCryptHasherOption) error

func WithCost

func WithCost(cost int) BCryptHasherOptFunc

set the hash cost.

reference:

https://pkg.go.dev/golang.org/x/crypto/bcrypt

type BCryptHasherOption

type BCryptHasherOption struct {
	Cost int
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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