资源简介
麻省理工开发实现的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个文件信息
- 上一篇:2016年下半年软件设计师下午真题及答案
- 下一篇:华工往年编译原理试卷
相关资源
- 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文件共享系统 含代码和文档
- Artificial Unintelligence_How Computers Misund
- 基础模拟和数字电路习题解答 英文原
- 麻省理工学院MIT奥本海姆信号与系统
- 综合运用端口匹配、深度数据包检测
- p2p 的简单实现 上传文件
- Termite-20180926.rar
- gamit 10.7 开源软件
- 数字信号处理课后答案 - Sanjit K Mitr
- 一套 MIT 的人脸训练样本库
- MIT最优控制原理
- MIT Xv6 操作系统源码详解最新版 rev1
- jxse-doc-2.5
- Foundations of Machine Learning 2nd Edition
- MIT行人检测数据库JPG格式
- mit Adaboost训练人脸库
- SMITH圆圈V3.1和谐版.zip
- Smith chart V3.1
- P2P软件Shareaza 2.2.4.0源码
评论
共有 条评论