文件名称:DESProcess
介绍说明--下载内容来自于网络,使用问题请自行百度
DESProcess
FILE *mfp,*cfp
int ttch=0,xorRes,ttbitdiff=0
char mch,cch
float bdiff=0
if((mfp=fopen(mfile,\"r\"))==NULL)
{cout<<\"Cannot open the file to compare\"<<endl }
if((cfp=fopen(cfile,\"r\"))==NULL)
{cout<<\"Cannot open the file to compare\"<<endl }
else
{
while(!feof(mfp)&!feof(cfp))
{
ttch++
mch=fgetc(mfp)
cch=fgetc(cfp)
xorRes=mch^cch
ttbitdiff+=(xorRes&1)+(xorRes&2)/2+(xorRes&4)/4+(xorRes&8)/8+(xorRes&16)/16+(xorRes&32)/32+(xorRes&64)/64+(xorRes&128)/128
}
bdiff=float(ttbitdiff)*100/float(ttch*8)
}
*bitdiff8byte=float(ttbitdiff)*100/float(8*8)
return bdiff
FILE *mfp,*cfp
int ttch=0,xorRes,ttbitdiff=0
char mch,cch
float bdiff=0
if((mfp=fopen(mfile,\"r\"))==NULL)
{cout<<\"Cannot open the file to compare\"<<endl }
if((cfp=fopen(cfile,\"r\"))==NULL)
{cout<<\"Cannot open the file to compare\"<<endl }
else
{
while(!feof(mfp)&!feof(cfp))
{
ttch++
mch=fgetc(mfp)
cch=fgetc(cfp)
xorRes=mch^cch
ttbitdiff+=(xorRes&1)+(xorRes&2)/2+(xorRes&4)/4+(xorRes&8)/8+(xorRes&16)/16+(xorRes&32)/32+(xorRes&64)/64+(xorRes&128)/128
}
bdiff=float(ttbitdiff)*100/float(ttch*8)
}
*bitdiff8byte=float(ttbitdiff)*100/float(8*8)
return bdiff
(系统自动生成,下载前可以参看下载内容)
下载文件列表
destest.cpp
mo2.txt
c1.txt
m1.txt
mo1.txt
c2.txt
m2.txt
DESProcess.cpp
DESProcess.h
www.dssz.com.txt
mo2.txt
c1.txt
m1.txt
mo1.txt
c2.txt
m2.txt
DESProcess.cpp
DESProcess.h
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.