diff options
| author | 2025-11-16 00:00:00 +0000 | |
|---|---|---|
| committer | 2025-11-16 00:00:00 +0000 | |
| commit | b6d4ab71d42234a4ae2678083d1b7558b8e6519f (patch) | |
| tree | 993c8a56ee9b2a72237e29cbf41767d4986c2fc5 /hash.go | |
| parent | hash: Make fewer helper functions need explicit hash length fields (diff) | |
| signature | ||
Make the API more consistent
Diffstat (limited to 'hash.go')
| -rw-r--r-- | hash.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -36,16 +36,16 @@ var hashFuncs = map[int]hashFunc{ } // String returns the ID as hex using its internal size. -func (id Hash) String() string { - return hex.EncodeToString(id.data[:id.size]) +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. -func (id Hash) Bytes() []byte { - return append([]byte(nil), id.data[:id.size]...) +func (hash Hash) Bytes() []byte { + return append([]byte(nil), hash.data[:hash.size]...) } // Size returns the hash size. -func (id Hash) Size() int { - return id.size +func (hash Hash) Size() int { + return hash.size } |
