Skip to content

Instantly share code, notes, and snippets.

@olof
Created July 30, 2016 15:33
Show Gist options
  • Save olof/236abfb93ff3478a9031171ade22d98e to your computer and use it in GitHub Desktop.
Save olof/236abfb93ff3478a9031171ade22d98e to your computer and use it in GitHub Desktop.
Get info hash from torrent file
perl -M5.010 \
-MFile::Slurp -MYAML -MBencode=bdecode,bencode -MDigest::SHA=sha1_hex \
-e 'say sha1_hex bencode bdecode(scalar read_file shift)->{info}' \
<torrentfile>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment