From b6d4ab71d42234a4ae2678083d1b7558b8e6519f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 16 Nov 2025 00:00:00 +0000 Subject: Make the API more consistent --- hash.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'hash.go') 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 } -- cgit v1.3.1-10-gc9f91