Documentation ¶
Overview ¶
Package githash provides a type for Git object hashes.
Index ¶
Constants ¶
View Source
const SHA1Size = 20
SHA1Size is the number of bytes in a SHA-1 hash.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SHA1 ¶
A SHA1 is the SHA-1 hash of a Git object.
func ParseSHA1 ¶
ParseSHA1 parses a hex-encoded SHA-1 hash. It is the same as calling UnmarshalText on a new SHA1.
func (SHA1) Format ¶
Format implements the fmt.Formatter interface. Specifically, it ensures that %x does not double-hex-encode the data.
func (SHA1) MarshalBinary ¶
MarshalBinary returns the hash as a byte slice.
func (SHA1) MarshalText ¶
MarshalText returns the hex-encoded hash.
func (*SHA1) UnmarshalBinary ¶
UnmarshalBinary copies the bytes from b into h. It returns an error if len(b) != len(*h).
func (*SHA1) UnmarshalText ¶
UnmarshalText decodes a hex-encoded hash into h.
Click to show internal directories.
Click to hide internal directories.