'http://www.bittorrent.org/beps/bep_0020.html'

def _generate_peer_id(self):

    peer_id = (('-PU' + __version__.replace('.', '-')) + '-')
    remaining = (20 - len(peer_id))
    numbers = [str(random.randint(0, 9)) for _ in xrange(remaining)]
    peer_id += ''.join(numbers)
    assert (len(peer_id) == 20)
    return peer_id
