Discover Packages
github.com/jcobhams/pash
package
module
Version:
v0.0.0-...-9bfb934
Opens a new window with list of versions in this module.
Published: Oct 25, 2020
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
PASH - Password Hasher
Simple password hashing and verification utility. Uses bcrypt.
There are 4 hashing options provided.
HashMinCost()
: uses bcrypt.MinCost
currently 4
(at the time of writing)
Hash()
: uses bcrypt.DefaultCost
currently 10
HashMaxCost()
: uses bcrypt.MaxCost
currently 31
HashWithCost()
: accepts a variable cost factor. Use with care. The higher the cost factor, the more time it takes to
yield a result (or crack) .
Why?
Because I got tired of duplicating across pet projects.
Expand ▾
Collapse ▴
Documentation
¶
Hash uses `bcrypt.DefaultCost` currently `10`
HashMaxCost uses `bcrypt.MaxCost` currently `31`
HashMinCost uses `bcrypt.MinCost` currently `4`
HashWithCost accepts a variable cost factor. Use with care. The higher the cost factor, the more time it takes to
yield a result (or crack).
VerifyHash takes the hashed string and the raw string, performs a comparison if hashes match.
returns true if the do or false if not. Any errors will be returned as well.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.