aboutsummaryrefslogtreecommitdiff
path: root/object/id/algorithm_parse.go
blob: 271c3e60c245f716f42419d1ef16f21216c10b96 (about) (plain) (blame)
1
2
3
4
5
6
7
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
}