FedP2P/cmd/torrent-infohash/main.go

21 lines
283 B
Go

package main
import (
"flag"
"fmt"
"log"
"github.com/anacrolix/libtorgo/metainfo"
)
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.Info.Hash, arg)
}
}