BLOG main image


사용 예



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);


}







http://rhash.anz.ru/


라이센스는 MIT 라이센스




Home    Download    Change Log    Manual    Hash Functions    Wiki    License ru | en 

RHash Program


RHash (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:

  • Can calculate Magnet links.
  • Output in a predefined (SFV, BSD-like) or user defined format.
  • Ability to process directories recursively.
  • Updating of existing hash files (adding sums of files missing in the hash file).
  • Calculates several hash sums in one pass.
  • Portability: the program works the same under Linux, *BSD, or Windows.

RHash is written in pure C, small in size and is distributed under Open Source License.

Support This ProjectDownload RHash.

반응형

+ Recent posts