사용 예
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. |
'프로그래밍(Programming) > Library' 카테고리의 다른 글
FreeType 라이브러리 & D3D (0) | 2013.08.24 |
---|---|
정점캐시 최적화 도구 edge library? 어디있는거지 (0) | 2013.05.27 |
압축 라이브러리 - Zlib, CGZip, LiteZip, Zip Utils, Minizip (0) | 2013.05.18 |
Loki 라이브러리 (0) | 2013.05.11 |
난수생성기 - 메르센 트위스터(Mersenne Twister) (0) | 2013.05.11 |