Documentation ¶
Overview ¶
Package phash implements simple functions for saltling, hashing and later verifying passwords against hashes. It is intended to be complatible with the Node.js package "password-hash".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Gen ¶
Gen converts a plain text password to a hash with a salt. It uses sha1, a salt lenght of 8, and applies the algorithm once.
func Generate ¶
Generate converts a plain text password to a hash with a salt. It allows the caller to specify the algorithm, salt length, and number of times to apply the algorithm.
func Verify ¶
Verify compares a plain text password against a hash with a salt and returns true if the two match. If the hash algorithm used for the hash isn't linked to the binary, Verify automatically returns false. See http://golang.org/pkg/crypto/#RegisterHash for more details.
Types ¶
This section is empty.