aboutsummaryrefslogtreecommitdiff
path: root/object/id/algorithm.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-04-02 07:21:57 +0000
committerGravatar Runxi Yu2026-04-02 07:21:57 +0000
commitad18ac06566b7fead9123ea588d516e7bcc9fd15 (patch)
tree8f7e7715bade45d4a6a02520648780e2ce3c783f /object/id/algorithm.go
parentobject/id: Document (diff)
signatureNo signature
object/id: Add algorithm
Diffstat (limited to 'object/id/algorithm.go')
-rw-r--r--object/id/algorithm.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/object/id/algorithm.go b/object/id/algorithm.go
new file mode 100644
index 00000000..47a1b02a
--- /dev/null
+++ b/object/id/algorithm.go
@@ -0,0 +1,17 @@
+package id
+
+// Algorithm identifies the hash algorithm used for Git object IDs.
+type Algorithm uint8
+
+const (
+ // AlgorithmUnknown identifies an unknown object ID hash algorithm.
+ AlgorithmUknown Algorithm = iota
+
+ // AlgorithmSHA1 identifies the SHA-1 object ID hash algorithm.
+ // This is the default for all versions of Git until Git 3.0.
+ AlgorithmSHA1
+
+ // AlgorithmSHA256 identifies the SHA-256 object ID hash algorithm.
+ // This is the default for Git 3.0 and beyond.
+ AlgorithmSHA256
+)