From ad18ac06566b7fead9123ea588d516e7bcc9fd15 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 2 Apr 2026 07:21:57 +0000 Subject: object/id: Add algorithm --- object/id/algorithm.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 object/id/algorithm.go (limited to 'object/id/algorithm.go') 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 +) -- cgit v1.3.1-10-gc9f91