MCPcopy Create free account
hub / github.com/pion/dtls / String

Method String

pkg/crypto/hash/hash.go:32–53  ·  view source on GitHub ↗

String makes hashAlgorithm printable.

()

Source from the content-addressed store, hash-verified

30
31// String makes hashAlgorithm printable.
32func (a Algorithm) String() string {
33 switch a {
34 case None:
35 return "none"
36 case MD5:
37 return "md5" // [RFC3279]
38 case SHA1:
39 return "sha-1" // [RFC3279]
40 case SHA224:
41 return "sha-224" // [RFC4055]
42 case SHA256:
43 return "sha-256" // [RFC4055]
44 case SHA384:
45 return "sha-384" // [RFC4055]
46 case SHA512:
47 return "sha-512" // [RFC4055]
48 case Ed25519:
49 return "null"
50 default:
51 return "unknown or unsupported hash algorithm"
52 }
53}
54
55// Digest performs a digest on the passed value.
56func (a Algorithm) Digest(b []byte) []byte {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected