aboutsummaryrefslogtreecommitdiff
path: root/object/id/algorithm_parse.go
blob: d5fb0c642f6a2e192918c3b2e21d37b108d94b76 (about) (plain) (blame)
1
2
3
4
5
6
7
8
package objectid

// ParseAlgorithm parses a canonical algorithm name (e.g. "sha1", "sha256").
func ParseAlgorithm(s string) (Algorithm, bool) {
	algo, ok := algorithmByName[s]

	return algo, ok
}