随笔分类 - P2P
BtTorrent 的 bencoding
摘要:bencoding是BT用来说明与组织数据的格式。BitTorrent-4.1.6\BitTorrent\bencode.py是算法的实现。bencoding相当简单,不过我还是写了一个UnitTest来验证我的理解。 1 import unittest 2 from BitTorrent.bencode import * 3 4 class testBencodeFun(unitte...
阅读全文
TinyP2P 世界最小的P2P应用
摘要:# tinyp2p.py 1.0 (documentation at http://freedom-to-tinker.com/tinyp2p.html) import sys, os, SimpleXMLRPCServer, xmlrpclib, re, hmac # (C) 2004, E.W. Felten ar,pw,res = (sys.argv,lambda u:hmac.new(sy...
阅读全文