Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing algorithm. See http://www.usenix.org/event/usenix99/provos/provos.pdf
The error returned from CompareHashAndPassword when a hash is too short to be a bcrypt hash.
The error returned from CompareHashAndPassword when a password and hash do not match.
CompareHashAndPassword compares a bcrypt hashed password with its possible plaintext equivalent. Returns nil on success, or an error on failure.
Cost returns the hashing cost used to create the given hashed password. When, in the future, the hashing cost of a password system needs to be increased in order to adjust for greater computational power, this function allows one to establish which passwords need to be updated.
GenerateFromPassword returns the bcrypt hash of the password at the given cost. If the cost given is less than MinCost, the cost will be set to DefaultCost, instead. Use CompareHashAndPassword, as defined in this package, to compare the returned hashed password with its cleartext version.
The error returned from CompareHashAndPassword when a hash was created with a bcrypt algorithm newer than this implementation.
The error returned from CompareHashAndPassword when a hash starts with something other than '$'