NewHashFromStr creates a Hash from a hash string. The string should be the hexadecimal string of a byte-reversed hash, but any missing characters result in zero padding at the end of the Hash.
(hash string)
| 184 | // the hexadecimal string of a byte-reversed hash, but any missing characters |
| 185 | // result in zero padding at the end of the Hash. |
| 186 | func NewHashFromStr(hash string) (*Hash, error) { |
| 187 | ret := new(Hash) |
| 188 | err := Decode(ret, hash) |
| 189 | if err != nil { |
| 190 | return nil, err |
| 191 | } |
| 192 | return ret, nil |
| 193 | } |
| 194 | |
| 195 | // Decode decodes the byte-reversed hexadecimal string encoding of a Hash to a |
| 196 | // destination. |