torrent-infohash: utility to print the info hash of a torrent file

This commit is contained in:
Matt Joiner 2014-07-10 00:15:03 +10:00
parent 1e4862ace8
commit 7928b763d9
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
package main
import (
"flag"
"fmt"
"github.com/anacrolix/libtorgo/metainfo"
"log"
)
func main() {
flag.Parse()
for _, arg := range flag.Args() {
mi, err := metainfo.LoadFromFile(arg)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%x: %s\n", mi.InfoHash, arg)
}
}