Advertising
advertising
related pastes to tag 'bittorrent'
- 1523340 - torrents.py: python bittorrent
-
- #!/usr/bin/python3.1 -O
- '''
- Library for making torrent files
- '''
- from functools import reduce
- from hashlib import sha1
- 824722 - Someone: cisco wow bittorrent 2500 2514 firewall
-
- fw2514#sh run
- Building configuration...
- Current configuration : 1978 bytes
- !
- version 12.2
- service nagle
- service tcp-keepalives-in
- 821255 - Python bencode/decode: bittorrent encode bencode
-
- def encode(arg):
- ''' Given that we're converting between variable formats,
- manual typechecking seems excusable here '''
- return {
- int : lambda x: 'i%ie' % x,
- str : lambda x: '%i:%s' % (len(x), x),
- list : lambda x: 'l%se' % ''.join(map(encode, arg)),
- dict : lambda x: 'd%se' % ''.join(''.join(map(encode, i)) for i in arg.items())
- 819134 - Python bencode/decode: bittorrent encode bencode
-
- def encode(arg):
- ''' Given that we're converting between variable formats,
- manual typechecking seems excusable here '''
- return {
- int : lambda x: 'i%ie' % x,
- str : lambda x: '%i:%s' % (len(x), x),
- list : lambda x: 'l%se' % ''.join(map(encode, arg)),
- dict : lambda x: 'd%se' % ''.join(''.join(map(encode, i)) for i in arg.items())