Add sha512-224sum

This commit is contained in:
dtluna committed 2019-03-27 14:42:51 +03:00
1 parent baeafa3ab5
commit b7af56dadf
3 files changed
+15 -1

No files matched your search

+1 -1
View File
@@ -71,7 +71,7 @@ Utilities:
* [x] `sha224sum`
* [x] `sha256sum`
* [x] `sha384sum`
* [ ] `sha512-224sum`
* [x] `sha512-224sum`
* [ ] `sha512-256sum`
* [x] `sha512sum`
* [ ] `sleep`
+5
View File
@@ -22,6 +22,7 @@ var SHA224Regex = regexp.MustCompile("^(?P<hash>[0-9a-f]{56}) (?P<filename>.*)$
var SHA256Regex = regexp.MustCompile("^(?P<hash>[0-9a-f]{64}) (?P<filename>.*)$")
var SHA384Regex = regexp.MustCompile("^(?P<hash>[0-9a-f]{96}) (?P<filename>.*)$")
var SHA512Regex = regexp.MustCompile("^(?P<hash>[0-9a-f]{128}) (?P<filename>.*)$")
var SHA512_224Regex = SHA224Regex
// SumFunc is a type of function that computes a hash.Hash for data in io.Reader
type SumFunc func(io.Reader) (hash.Hash, error)
@@ -57,6 +58,10 @@ func SHA512Sum(r io.Reader) (hash.Hash, error) {
return copyIntoHash(r, sha512.New())
}
func SHA512_224Sum(r io.Reader) (hash.Hash, error) {
return copyIntoHash(r, sha512.New512_224())
}
type CheckingResults struct {
ImproperlyFormattedCount uint
InvalidChecksumCount uint
+9
View File
@@ -0,0 +1,9 @@
package main
import (
common "source.heropunch.io/tomo/go-coreutils"
)
func main() {
common.SumMain(common.SHA512_224Regex, common.SHA512_224Sum)
}