Documentation
¶
Overview ¶
Package sha1 implements a Django compatible SHA1 algorithm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHashComponentMismatch = errors.New("unchained/sha1: hashed password components mismatch") ErrAlgorithmMismatch = errors.New("unchained/sha1: algorithm mismatch") ErrSaltContainsDollarSing = errors.New("unchained/sha1: salt contains dollar sign ($)") ErrSaltIsEmpty = errors.New("unchained/sha1: salt is empty") )
Errors returned by SHA1PasswordHasher.
Functions ¶
This section is empty.
Types ¶
type SHA1PasswordHasher ¶
type SHA1PasswordHasher struct { // Algorithm identifier. Algorithm string // Use salt to encode. Salted bool }
SHA1PasswordHasher implements Salted SHA1 password hasher.
func NewSHA1PasswordHasher ¶
func NewSHA1PasswordHasher() *SHA1PasswordHasher
NewSHA1PasswordHasher secures password hashing using Salted SHA1 algorithm (not recommended).
func NewUnsaltedSHA1PasswordHasher ¶
func NewUnsaltedSHA1PasswordHasher() *SHA1PasswordHasher
NewUnsaltedSHA1PasswordHasher is an incredibly insecure algorithm that should never be used. It stores unsalted SHA1 hashes with an empty salt.
This algorithm is implemented because Django used to store passwords this way and to accept such password hashes.
Click to show internal directories.
Click to hide internal directories.