String makes hashAlgorithm printable.
()
| 30 | |
| 31 | // String makes hashAlgorithm printable. |
| 32 | func (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. |
| 56 | func (a Algorithm) Digest(b []byte) []byte { |
nothing calls this directly
no outgoing calls
no test coverage detected