FindHash returns a func to create a new hash based on the provided name.
(name string)
| 42 | |
| 43 | // FindHash returns a func to create a new hash based on the provided name. |
| 44 | func FindHash(name string) func() hash.Hash { |
| 45 | switch strings.ToUpper(name) { |
| 46 | case "SHA1": |
| 47 | return sha1.New |
| 48 | } |
| 49 | return nil |
| 50 | } |
| 51 | |
| 52 | // ComputeHash applies the hash h to the file located at path. Returns a line |
| 53 | // of dashes for directories. |
no outgoing calls