aboutsummaryrefslogtreecommitdiff
path: root/object/id/algorithm_ops.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-04-02 07:51:14 +0000
committerGravatar Runxi Yu2026-04-02 07:53:36 +0000
commit1013f61420d39fe491bd1e1af613c601dc5c3137 (patch)
tree3171754f4404916b04d8f08b77bc629af51cefab /object/id/algorithm_ops.go
parentobject/id: Add algorithm tests (diff)
signatureNo signature
ci: Stricter linting
Diffstat (limited to 'object/id/algorithm_ops.go')
-rw-r--r--object/id/algorithm_ops.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/object/id/algorithm_ops.go b/object/id/algorithm_ops.go
index b746dc5f..01d26c08 100644
--- a/object/id/algorithm_ops.go
+++ b/object/id/algorithm_ops.go
@@ -6,7 +6,7 @@ import "hash"
// an empty tree ("tree 0\x00")
// for this algorithm.
func (algo Algorithm) EmptyTree() ObjectID {
- return algo.info().emptyTree
+ return algo.details().emptyTree
}
// HexLen returns the encoded hexadecimal length.
@@ -16,12 +16,12 @@ func (algo Algorithm) HexLen() int {
// Size returns the hash size in bytes.
func (algo Algorithm) Size() int {
- return algo.info().size
+ return algo.details().size
}
// New returns a new hash.Hash for this algorithm.
func (algo Algorithm) New() (hash.Hash, error) {
- newFn := algo.info().new
+ newFn := algo.details().new
if newFn == nil {
return nil, ErrInvalidAlgorithm
}
@@ -33,22 +33,22 @@ func (algo Algorithm) New() (hash.Hash, error) {
//
// Unknown algorithms return 0.
func (algo Algorithm) PackHashID() uint32 {
- return algo.info().packHashID
+ return algo.details().packHashID
}
// SignatureHeaderName returns the signature header name for this algorithm.
func (algo Algorithm) SignatureHeaderName() string {
- return algo.info().signatureHeaderName
+ return algo.details().signatureHeaderName
}
// String returns the canonical algorithm name.
func (algo Algorithm) String() string {
- return algo.info().name
+ return algo.details().name
}
// Sum computes an object ID from raw data using the selected algorithm.
func (algo Algorithm) Sum(data []byte) ObjectID {
- return algo.info().sum(data)
+ return algo.details().sum(data)
}
// Zero returns the all-zero object ID for this algorithm.