aboutsummaryrefslogtreecommitdiff
path: root/object/id/algorithm_ops.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-05-24 11:07:16 +0000
committerGravatar Runxi Yu2026-05-24 11:09:59 +0000
commit36340918040627d93808c09dea8d9bd7b7457f82 (patch)
treedab5fa0edbf2f2bf315d1fda73c0f7ac5c8fc6d9 /object/id/algorithm_ops.go
parentinternal/testgit: Add Algorithm method (diff)
signatureNo signature
object/id: Rename algorithm to object format
Diffstat (limited to 'object/id/algorithm_ops.go')
-rw-r--r--object/id/algorithm_ops.go41
1 files changed, 0 insertions, 41 deletions
diff --git a/object/id/algorithm_ops.go b/object/id/algorithm_ops.go
deleted file mode 100644
index 80f1f9cd..00000000
--- a/object/id/algorithm_ops.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package id
-
-import "hash"
-
-// HexLen returns the encoded hexadecimal length.
-func (algo Algorithm) HexLen() int {
- return algo.Size() * 2
-}
-
-// Size returns the hash size in bytes.
-func (algo Algorithm) Size() int {
- return algo.details().size
-}
-
-// New returns a new hash.Hash for this algorithm.
-func (algo Algorithm) New() (hash.Hash, error) {
- newFn := algo.details().new
- if newFn == nil {
- return nil, ErrInvalidAlgorithm
- }
-
- return newFn(), nil
-}
-
-// String returns the canonical algorithm name.
-func (algo Algorithm) String() string {
- 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.details().sum(data)
-}
-
-// Zero returns the all-zero object ID for this algorithm.
-func (algo Algorithm) Zero() ObjectID {
- return ObjectID{
- algo: algo,
- data: [maxObjectIDSize]byte{},
- }
-}