Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

advertising

related pastes to tag 'bittorrent'

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