IsHash returns true if the given string is a valid hash.
(s string)
| 74 | |
| 75 | // IsHash returns true if the given string is a valid hash. |
| 76 | func IsHash(s string) bool { |
| 77 | switch len(s) { |
| 78 | case hash.HexSize: |
| 79 | _, err := hex.DecodeString(s) |
| 80 | return err == nil |
| 81 | default: |
| 82 | return false |
| 83 | } |
| 84 | } |
no outgoing calls
searching dependent graphs…