diff options
| author | 2026-04-02 07:34:09 +0000 | |
|---|---|---|
| committer | 2026-04-02 07:34:09 +0000 | |
| commit | f805d0ba947e0aa39ca8040cf71b7e0fad3de919 (patch) | |
| tree | b683eb327f94a02a17c406631089fa1f8bc28b9a /object/id/algorithm_parse.go | |
| parent | object/id: Add algorithm (diff) | |
| signature | No signature | |
object/id: Add algorithm stuff
Diffstat (limited to 'object/id/algorithm_parse.go')
| -rw-r--r-- | object/id/algorithm_parse.go | 8 |
1 files changed, 8 insertions, 0 deletions
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 +} |
