aboutsummaryrefslogtreecommitdiff
path: root/object/id/algorithm_parse.go
blob: 7349288f89977b5159c982aa25f861c16af0dd45 (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
}