From f805d0ba947e0aa39ca8040cf71b7e0fad3de919 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 2 Apr 2026 07:34:09 +0000 Subject: object/id: Add algorithm stuff --- object/id/algorithm_parse.go | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 object/id/algorithm_parse.go (limited to 'object/id/algorithm_parse.go') diff --git a/object/id/algorithm_parse.go b/object/id/algorithm_parse.go new file mode 100644 index 00000000..7349288f --- /dev/null +++ b/object/id/algorithm_parse.go @@ -0,0 +1,8 @@ +package id + +// ParseAlgorithm parses a canonical algorithm name (e.g. "sha1", "sha256"). +func ParseAlgorithm(s string) (Algorithm, bool) { + algo, ok := algorithmByName[s] + + return algo, ok +} -- cgit v1.3.1-10-gc9f91