aboutsummaryrefslogtreecommitdiff
path: root/hash.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2025-11-16 00:00:00 +0000
committerGravatar Runxi Yu2025-11-16 00:00:00 +0000
commitb6d4ab71d42234a4ae2678083d1b7558b8e6519f (patch)
tree993c8a56ee9b2a72237e29cbf41767d4986c2fc5 /hash.go
parenthash: 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.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/hash.go b/hash.go
index 1ca26391..98c36c2e 100644
--- a/hash.go
+++ b/hash.go
@@ -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
}