shithub: furgit

Download patch

ref: fe595229e41f9aea5c08d5ab3889804b77a70359
parent: 3b44bb05f74ebd2734f12808c813dae2995b41b1
author: Runxi Yu <me@runxiyu.org>
date: Fri Feb 20 19:22:40 EST 2026

objectid: Add SupportedAlgorithms

--- a/objectid/objectid.go
+++ b/objectid/objectid.go
@@ -69,6 +69,7 @@
 }
 
 var algorithmByName = map[string]Algorithm{}
+var supportedAlgorithms []Algorithm
 
 func init() {
 	for algo, info := range algorithmTable {
@@ -75,12 +76,20 @@
 		if info.name == "" {
 			continue
 		}
-		algorithmByName[info.name] = Algorithm(algo)
+		parsed := Algorithm(algo)
+		algorithmByName[info.name] = parsed
+		supportedAlgorithms = append(supportedAlgorithms, parsed)
 	}
 }
 
 func (algo Algorithm) info() algorithmDetails {
 	return algorithmTable[algo]
+}
+
+// SupportedAlgorithms returns all object ID algorithms supported by furgit.
+// Do not mutate.
+func SupportedAlgorithms() []Algorithm {
+	return supportedAlgorithms
 }
 
 // ParseAlgorithm parses a canonical algorithm name (e.g. "sha1", "sha256").
--