Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hash指纹信息文件(序列化方案) #4

Open
Darkgel opened this issue Mar 7, 2017 · 0 comments
Open

hash指纹信息文件(序列化方案) #4

Darkgel opened this issue Mar 7, 2017 · 0 comments

Comments

@Darkgel
Copy link
Contributor

Darkgel commented Mar 7, 2017

.synchash存在于U盘的同步根目录下,.synchash文件就是hash指纹信息文件,以下都称为.synchash文件

.synchash文件是怎么来的?
      .synchash文件实际上就是将“哈希数组链表”(就是darkgel发的“哈希链表图”这个文件里所展示的数据结构)     
      持久化后得到的

 哈希链表的一些默认值:
            数组长度:3000(暂定)
            采用的哈希算法:论文中改进的BKDR算法(参考issue“改进的BKDR算法”)
            哈希链表初始化:数组元素置为null;
            哈希码长度:32位
            文件名hash指纹信息的初始化:全部置0/null/空串(根据实际情况来)
            文件内容hash指纹信息的初始化:全部置0/null/空串(根据实际情况来)

如何将哈希链表持久化(并保存成文件.synchash)与反持久化?
           使用pickle 模块(为了提高效率,实际使用的应该是cPickle )
           使用的时候要注意兼容性和效率
           具体实现参考以下链接:  
                   https://blog.oldj.net/2010/05/26/python-pickle/
                   https://www.ibm.com/developerworks/cn/linux/l-pypers/


hashtable的Python实现:
      https://www.nosuchfield.com/2016/07/29/the-python-implementationp-of-HashTable/


@Darkgel Darkgel changed the title hash指纹信息文件 hash指纹信息文件(序列化方案) Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant