Net::BitTorrent::Version - Net::BitTorrent's project-wide version numbers


Net-BitTorrent documentation  | view source Contained in the Net-BitTorrent distribution.

Index


NAME

Top

Net::BitTorrent::Version - Net::BitTorrent's project-wide version numbers

DESCRIPTION

Top

Because of the problems coordinating revision numbers in a distributed version control system and across a directory full of Perl modules, this module provides a central location for the project's overall release number, the version string provided in Extended Protocol handshakes, and the Peer ID generator.

Methods

Top

gen_node_id ( )

Returns a random 20-byte string that can be used to identify ourself in a DHT swarm.

gen_peerid ( )

Generates a unique Peer ID based on Net::BitTorrent's Specification.

Peer ID Specification

Top

This section describes and provides examples of the Peer ID format used by this release of the Net::BitTorrent module.

Overview

This non-standard format was developed to be URL-safe, unique to the implementation, and "human parsable."

There are two distinct sections to the Peer IDs generated: the header which may be used to identify the software and its version, and the signature which is... well, it's junk. Consider this example:

 NB004S-rogzGB1v--git

Here, NB004S is the header and -rogzGB1v--git is the trailing signature.

The header consists of two uppercase characters ('NB') followed by three digits (with leading zeros) representing the distribution version and a single character used to (potentially) indicate stability: Stable or Unstable. Any deviation from this indicates a bad client. Recent stable builds will be found on CPAN.

Signature

The remainder of the Peer ID is a hyphen followed by 13 random characters in the following range:

 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~

That is, all uppercase and lowercase letters, decimal digits, as well as the hyphen, period, underscore, and tilde (66 total). These are all characters allowed in a URL without being encoded (referred to as "Unreserved Characters" in rfc 3986).

Version Numbers and Stability

Distribution version numbers will be some value less than one (1) with the revision number in the three significant decimal places.

Recent stable builds will be found on CPAN. Unstable builds will most likely be private builds or temporary uploads to CPAN where the package name matches m[\d\.\d+_\d]. See the PAUSE FAQ section entitled "Developer Releases" (http://www.cpan.org/modules/04pause.html).

Examples

NB393S-04.9EraQ--git

This would be the stable CPAN-ready release v0.393. The --git signature does not imply an unstable build.

NB003X-9E-ayR6-I<3BT

Improper Peer ID; the sixth char is neither 'S' nor 'U' and < is a reserved character according to rfc: 3986.

NB065U--09Egae69sy8W

Completely legal Peer ID generated by unstable build around v65.

See Also

Top

rfc3986RFC 3986 (URI: Generic Syntax) Section 2.3. "Unreserved Characters" (http://tools.ietf.org/html/rfc3986#section-2.3)

PAUSE FAQ sub-section entitled "Developer Releases" (http://www.cpan.org/modules/04pause.html)

http://slashdot.org/comments.pl?sid=997033&cid=25390887

Disclaimer

Top

This document and the specification behind it are subject to change. All modifications will be documented in the Changes file included with this distribution. All versions of this file can be found in the project's git repository.

Author

Top

Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/

CPAN ID: SANKO

License and Legal

Top


Net-BitTorrent documentation  | view source Contained in the Net-BitTorrent distribution.