资源简介
麻省理工开发实现的chord算法源代码 P2P四大经典算法之一

代码片段和文件信息
def str2bigint(s):
a = map(ord s)
v = 0L
for d in a:
v = v << 8
v = v | d
return v
class bigint(long):
def __new__(cls val = None):
if isinstance(val str):
return long.__new__(cls str2bigint(val))
else:
return long.__new__(cls val)
def __hex__(self):
return long.__hex__(self).lower()[2:-1]
def __str__(self):
return hex(self)
def pack_bigint(p v):
a = []
while v > 0:
a.append(chr(v & 0xFF))
v = v >> 8
# Ensure that remote end will decode as posititive
if len(a) and ord(a[-1]) & 0x80:
a.append(chr(0))
# Pad out to multiple of 4 bytes.
while len(a) % 4 != 0:
a.append(chr(0))
a.reverse()
p.pack_opaque(‘‘.join(a))
def unpack_bigint(u):
s = u.unpack_opaque()
return bigint(s)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-09-16 09:36 chord-0.1\
目录 0 2013-09-16 09:36 chord-0.1\.git\
目录 0 2013-09-16 09:36 chord-0.1\.git\branches\
文件 249 2013-09-16 09:32 chord-0.1\.git\config
文件 73 2013-09-16 09:32 chord-0.1\.git\desc
文件 23 2013-09-16 09:32 chord-0.1\.git\HEAD
目录 0 2013-09-16 09:36 chord-0.1\.git\hooks\
文件 452 2013-09-16 09:32 chord-0.1\.git\hooks\applypatch-msg.sample
文件 896 2013-09-16 09:32 chord-0.1\.git\hooks\commit-msg.sample
文件 189 2013-09-16 09:32 chord-0.1\.git\hooks\post-update.sample
文件 398 2013-09-16 09:32 chord-0.1\.git\hooks\pre-applypatch.sample
文件 1704 2013-09-16 09:32 chord-0.1\.git\hooks\pre-commit.sample
文件 4898 2013-09-16 09:32 chord-0.1\.git\hooks\pre-reba
文件 1239 2013-09-16 09:32 chord-0.1\.git\hooks\prepare-commit-msg.sample
文件 3611 2013-09-16 09:32 chord-0.1\.git\hooks\update.sample
文件 17976 2013-09-16 09:32 chord-0.1\.git\index
目录 0 2013-09-16 09:36 chord-0.1\.git\info\
文件 240 2013-09-16 09:32 chord-0.1\.git\info\exclude
目录 0 2013-09-16 09:36 chord-0.1\.git\logs\
文件 162 2013-09-16 09:32 chord-0.1\.git\logs\HEAD
目录 0 2013-09-16 09:36 chord-0.1\.git\logs\refs\
目录 0 2013-09-16 09:36 chord-0.1\.git\logs\refs\heads\
文件 162 2013-09-16 09:32 chord-0.1\.git\logs\refs\heads\master
目录 0 2013-09-16 09:36 chord-0.1\.git\ob
目录 0 2013-09-16 09:36 chord-0.1\.git\ob
目录 0 2013-09-16 09:36 chord-0.1\.git\ob
文件 606880 2013-09-16 09:32 chord-0.1\.git\ob
文件 5337433 2013-09-16 09:32 chord-0.1\.git\ob
文件 94 2013-09-16 09:32 chord-0.1\.git\packed-refs
目录 0 2013-09-16 09:36 chord-0.1\.git\refs\
目录 0 2013-09-16 09:36 chord-0.1\.git\refs\heads\
............此处省略229个文件信息
- 上一篇:计算机专业英语名词的一些词汇
- 下一篇:华工往年编译原理试卷
相关资源
- Skype 协议分析(2006版)
- IBM SAN 数据网关解决方案助力Summit B
- 基于I-Fuzzy-Smith算法的融合控制策略仿
- Multiple limit cycles for three-dimensional Lo
- IP地址对照表
- UDP协议进行P2P打洞
- 易语言P2P聊天源码
- 易语言p2p服务器源码
- 易语言P2P源代码1源码易语言P2P网络电
- 易语言客户端源码易语言服务器源码
- p2p种子在线播放器绿色版
- Sniffer原理及开源代码
- PeerSim chord仿真
- 《反欺骗的艺术 Kevin D.Mitnick》PDF 高清
- P2P、网贷后台原型
- 概率导论第2版 课后答案
- Termite最新版1.8.4.zip
- 局域网封杀软件-P2POVER 2.7完美破解.
- UDP P2P打洞服务器
- FLASH局域网免服务器P2P聊天室源码(
- Finite-time blowup for the 3-D primitive equat
- 计算机网络课程设计: 基于P2P的局域
- MIT_App_Inventor_Tools_2.3.0_win_setup
- p2p搜索神器绿色无广告
- 基于KCP协议的P2P服务器和客户端
- Wireless Communications (Cambridge 2005) G
- 改进的模糊Smith串级主汽温控制仿真研
- TIMIT语音库压缩包
- JULIUSO. SMITHIII《INTRODUCTION TO DIGITAL FI
- p2p文件共享系统 含代码和文档
评论
共有 条评论