diff options
| author | 2025-11-16 00:00:00 +0000 | |
|---|---|---|
| committer | 2025-11-16 00:00:00 +0000 | |
| commit | 43c25d457becb64ed2f76fbe2935475056a1081a (patch) | |
| tree | d2cda5f0912ee3cd733aeda626096bd64115eabb /hash.go | |
| parent | Separate stored object types from types that the user is expected to construct. (diff) | |
| signature | ||
Documentation overhaul
Diffstat (limited to 'hash.go')
| -rw-r--r-- | hash.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -8,7 +8,7 @@ import ( const maxHashSize = 32 -// Hash represents a Git object identifier. +// Hash represents a Git object ID. type Hash struct { data [maxHashSize]byte size int @@ -35,12 +35,12 @@ var hashFuncs = map[int]hashFunc{ }, } -// String returns the ID as hex using its internal size. +// String returns a hexadecimal string representation of the hash. func (hash Hash) String() string { return hex.EncodeToString(hash.data[:hash.size]) } -// Bytes returns a mutable copy of the underlying bytes using its internal size. +// Bytes returns a mutable copy of the hash bytes. func (hash Hash) Bytes() []byte { return append([]byte(nil), hash.data[:hash.size]...) } |
