Encode encodes the raw bytes of a digest, typically from a hash.Hash, into the encoded portion of the digest.
(d []byte)
| 138 | // Encode encodes the raw bytes of a digest, typically from a hash.Hash, into |
| 139 | // the encoded portion of the digest. |
| 140 | func (a Algorithm) Encode(d []byte) string { |
| 141 | // TODO(stevvooe): Currently, all algorithms use a hex encoding. When we |
| 142 | // add support for back registration, we can modify this accordingly. |
| 143 | return fmt.Sprintf("%x", d) |
| 144 | } |
| 145 | |
| 146 | // FromReader returns the digest of the reader using the algorithm. |
| 147 | func (a Algorithm) FromReader(rd io.Reader) (Digest, error) { |
no outgoing calls
no test coverage detected