如何在Windows中的Rsync算法中生成哈希码 [英] How to generate the Hash code in Rsync Algorithm in windows

查看:53
本文介绍了如何在Windows中的Rsync算法中生成哈希码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我学会了Rsync算法(7stpes).
但是如何使用Windows c ++为一个文件生成哈希码.



i learned the Rsync Algorithm (7stpes).
but how to generate the hash code for the one file using windows c++.

推荐答案

Go to rsync official site...



http://rsync.samba.org 下载源代码,并且在checksum.c中有一个函数...



http://rsync.samba.org download the source code and in checksum.c there is a function...

void file_checksum(char *fname, char *sum, OFF_T size)





which actually computes checksum and md4 hash for a file. You need to port few functions like opening file and shared memory. use CreateFileMapping, MapViewOfFile, UnMapViewOfFile instead.If you don't want to write all that you can download my CSharedMemory from here...



持久哈希表:第2部分 [



Persistant Hash Table: Part 2[^]


这篇关于如何在Windows中的Rsync算法中生成哈希码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆