func runHash() {
hashes := flag.String("hashes", meta4ra.HashesDefault,
"hash-name:commandline[,...]")
+ all := flag.Bool("all", false, "Print all hashes, not the first one")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(),
"Usage: %s [-hashes ...] <data | read hash name\n", os.Args[0])
}
hsh := *hashes
- if i := strings.Index(hsh, ","); i != -1 {
- hsh = hsh[:i]
+ if !*all {
+ if i := strings.Index(hsh, ","); i != -1 {
+ hsh = hsh[:i]
+ }
}
hasher, err := meta4ra.NewHasher(hsh)
if err != nil {
if err != nil {
log.Fatal(err)
}
- fmt.Println(sums[0].Hash, sums[0].Type)
+ if *all {
+ for _, h := range sums {
+ fmt.Println(h.Type, h.Hash)
+ }
+ } else {
+ fmt.Println(sums[0].Hash, sums[0].Type)
+ }
}
)
const (
- Generator = "meta4ra/1.5.0"
+ Generator = "meta4ra/1.6.0"
SigMediaTypePGP = "application/pgp-signature"
SigMediaTypeSSH = "application/ssh-signature"
BufLen = 1 << 20