Short returns the hexadecimal string of the first `n` reversed byte(s).
(n int)
| 52 | |
| 53 | // Short returns the hexadecimal string of the first `n` reversed byte(s). |
| 54 | func (h Hash) Short(n int) string { |
| 55 | for i := 0; i < HashSize/2; i++ { |
| 56 | h[i], h[HashSize-1-i] = h[HashSize-1-i], h[i] |
| 57 | } |
| 58 | var l = HashSize |
| 59 | if n < l { |
| 60 | l = n |
| 61 | } |
| 62 | return hex.EncodeToString(h[:l]) |
| 63 | } |
| 64 | |
| 65 | // AsBytes returns internal bytes of hash. |
| 66 | func (h Hash) AsBytes() []byte { |
no outgoing calls