# README
kbfshash
The Keybase hash type. The package is named kbfshash
rather than
hash
for two reasons:
- To avoid conflicting with the
hash
package. - Variables may also be named
hash
.
All errors returned by this package are wrapped with pkg/errors, and so need errors.Cause() to unwrap them.
# Functions
DefaultHash computes the hash of the given data with the default hash type.
DefaultHMAC computes the HMAC with the given key of the given data using the default hash.
DoHash computes the hash of the given data with the given hash type.
DoRawDefaultHash computes the default keybase hash of the given data, and returns the type and the raw hash bytes.
HashFromBytes creates a hash from the given byte array.
HashFromRaw creates a hash from a type and raw hash data.
HashFromString creates a hash from the given string.
# Constants
DefaultHashByteLength is the number of bytes in a default keybase hash.
DefaultHashStringLength is the number of characters in the string representation of a default keybase hash.
DefaultHashType is the current default keybase hash type.
InvalidHash is the zero HashType value, which is invalid.
MaxHashByteLength is the maximum number of bytes a valid keybase hash can be, including the 1 byte for the type.
MaxHashStringLength is the maximum number of characters the string representation of a valid keybase hash can be.
MaxHashType is the highest-supported hash type.
MinHashByteLength is the minimum number of bytes a valid keybase hash can be, including the 1 byte for the type.
MinHashStringLength is the minimum number of characters in the string representation (hex encoding) of a valid keybase hash.
SHA256Hash is the type of a SHA256 hash.
SHA256HashV2 is the type of a SHA256 hash over V2-encrypted data.
TemporaryHashType is a hash type to be used for random byte-strings that can be used in place of real hashes.
# Variables
DefaultHashNew is a function that creates a new hash.Hash object with the default hash.
MaxDefaultHash is the maximum value of RawDefaultHash.
# Structs
Hash is the type of a keybase hash.
HashMismatchError is returned whenever a hash mismatch is detected.
HMAC is the type of a keybase hash that is an HMAC.
InvalidHashError is returned whenever an invalid hash is detected.
UnknownHashTypeError is returned whenever a hash with an unknown hash type is attempted to be used for verification.
# Type aliases
HashType is the type of a keybase hash.
RawDefaultHash is the type for the raw bytes of a default keybase hash.