本文整理汇总了C++中THash::Finish方法的典型用法代码示例。如果您正苦于以下问题:C++ THash::Finish方法的具体用法?C++ THash::Finish怎么用?C++ THash::Finish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类THash
的用法示例。
在下文中一共展示了THash::Finish方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HashFile
int HashFile(char **Return, char *Type, char *Path, int Encoding)
{
THash *Hash;
STREAM *S;
char *Tempstr=NULL;
int result;
S=STREAMOpenFile(Path,O_RDONLY);
if (! S) return(FALSE);
Hash=HashInit(Type);
if (! Hash)
{
STREAMClose(S);
return(FALSE);
}
Tempstr=SetStrLen(Tempstr,4096);
result=STREAMReadBytes(S,Tempstr,4096);
while (result !=EOF)
{
Hash->Update(Hash, Tempstr, result);
result=STREAMReadBytes(S,Tempstr,4096);
}
DestroyString(Tempstr);
STREAMClose(S);
result=Hash->Finish(Hash, Encoding, Return);
HashDestroy(Hash);
return(result);
}
示例2: HashBytes
int HashBytes(char **Return, char *Type, char *text, int len, int Encoding)
{
THash *Hash;
Hash=HashInit(Type);
Hash->Update(Hash, text, len);
return(Hash->Finish(Hash, Encoding, Return));
}
示例3: HashBytes
int HashBytes(char **Return, char *Type, char *text, int len, int Encoding)
{
THash *Hash;
int result;
Hash=HashInit(Type);
if (! Hash) return(0);
Hash->Update(Hash, text, len);
result=Hash->Finish(Hash, Encoding, Return);
HashDestroy(Hash);
return(result);
}
示例4: HMACFinish
int HMACFinish(THash *HMAC, int Encoding, char **HashStr)
{
THash *Hash;
int len, result;
Hash=(THash *) HMAC->Ctx;
//We've done with this now, blank it and reuse for the inner result
HMAC->Key1=CopyStr(HMAC->Key1,"");
len=Hash->Finish(Hash,0,&HMAC->Key1);
HMAC->Key2=SetStrLen(HMAC->Key2,HMAC_BLOCKSIZE+len);
memcpy(HMAC->Key2+HMAC_BLOCKSIZE,HMAC->Key1,len);
//Hash->Type
result=HashBytes(HashStr,Hash->Type,HMAC->Key2,HMAC_BLOCKSIZE+len,Encoding);
return(result);
}