Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
Net::BitTorrent::Util(User Contributed Perl DocumentatNet::BitTorrent::Util(3)

       Net::BitTorrent::Util - BitTorrent Related Utility Functions

Importing From Net::BitTorrent::Util
       By default, nothing is exported.

       You may import any of the following or use one or more of these tags:

	 Everything is imported	into your namespace.

	 You get the two Bencode-related functions: bencode and	bdecode.  For
	 more on Bencoding, see	the BitTorrent Protocol	documentation.

	 Imports the tracker response-related functions	compact	and uncompact.

       "bencode	( ARGS )"
	   Expects a single value (basic scalar, array reference, or hash
	   reference) and returns a single string.

	   Bencoding is	the BitTorrent protocol's basic	serialization and data
	   organization	format.	 The specification supports integers, lists
	   (arrays), dictionaries (hashes), and	byte strings.

       "bdecode	( STRING )"
	   Expects a bencoded string.  The return value	depends	on the type of
	   data	contained in the string.

       "compact	( LIST )"
	   Compacts a list of IPv4:port	strings	into a single string.

	   A compact peer is 6 bytes; the first	four bytes are the host	(in
	   network byte	order),	the last two bytes are the port	(again,	in
	   network byte	order).

       "uncompact ( STRING )"
	   Inflates a compacted	string of peers	and returns a list of
	   IPv4:port strings.

See Also
       The BitTorrent Protocol Specification

       BEP 32: Tracker Returns Compact Peer Lists

       Other Bencode related modules:

       Sanko Robinson <> -


License	and Legal
       Copyright (C) 2008-2009 by Sanko	Robinson <>

       This program is free software; you can redistribute it and/or modify it
       under the terms of The Artistic License 2.0.  See the LICENSE file
       included	with this distribution or  For	clarification,

       When separated from the distribution, all POD documentation is covered
       by the Creative Commons Attribution-Share Alike 3.0 License.  See  For
       clarification, see

       Neither this module nor the Author is affiliated	with BitTorrent, Inc.

perl v5.32.1			  2021-03-02	      Net::BitTorrent::Util(3)

NAME | Importing From Net::BitTorrent::Util | Functions | See Also | Author | License and Legal

Want to link to this manual page? Use this URL:

home | help