RHASH 해쉬키를 만들어주는 라이브러리
사용 예
calculate/check CRC32, MD5, SHA1, GOST, TTH, BTIH or other hash sums. 등이 포함되어있다
//Calculating SHA1 hash of a string
//const char* msg = "message digest";
const char* msg = "message digest";
unsigned char digest[64]={'\0',};
char output[130];
int res = rhash_msg(RHASH_CRC32, msg, strlen(msg), digest);
if(res < 0) {
fprintf(stderr, "hash calculation error\n");
return 1;
}
/* convert binary digest to hexadecimal string */
rhash_print_bytes(output, digest, rhash_get_digest_size(RHASH_SHA1), (RHPR_HEX | RHPR_UPPERCASE));
std::string dd= std::string(output,output+4);
//unsigned int data= std::string(output,output+4);
printf("%s (\"%s\") = %s\n", rhash_get_name(RHASH_SHA1), msg, output);
}
라이센스는 MIT 라이센스
Home Download Change Log Manual Hash Functions Wiki License | |
---|---|
RHash ProgramRHash (Recursive Hasher) is a console utility for computing and verifying hash sums of files. It supports CRC32, MD4, MD5, SHA1, SHA256, SHA512, Tiger, DC++ TTH, BitTorrent BTIH, ED2K, AICH, GOST R 34.11-94, RIPEMD-160, HAS-160, EDON-R 256/512, Whirlpool and Snefru-128/256 algorithms. Hash sums are used to ensure and verify integrity of large volumes of data for a long-term storing or transferring. Features:
RHash is written in pure C, small in size and is distributed under Open Source License. |