Sum applies padding to the hash state and then squeezes out the desired number of output bytes.
(in []byte)
| 186 | // Sum applies padding to the hash state and then squeezes out the desired |
| 187 | // number of output bytes. |
| 188 | func (d *state) Sum(in []byte) []byte { |
| 189 | // Make a copy of the original hash so that caller can keep writing |
| 190 | // and summing. |
| 191 | dup := d.clone() |
| 192 | hash := make([]byte, dup.outputLen) |
| 193 | dup.Read(hash) |
| 194 | return append(in, hash...) |
| 195 | } |