U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » [SOLVED] SHA1/MD5 encrypt example
Re: SHA1/MD5 encrypt example [message #21774 is a reply to message #21764] Thu, 04 June 2009 19:53 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Neither SHA1 or MD5 is crypting - both are hashes.

To obtain these hashes is simple. Say you have n bytes starting at ptr:

Cout() << SHA1String(ptr, n);

prints its has in hex form. SHA1StringS variant adds '-' into string.

If you are interested in hash bytes only, use SHA1 (and provide 20 bytes buffer to store the result).

If you want to process e.g. some very big file that you do not want to store into memory, use Sha1Stream - send all bytes to it, then retrieve result with one of

	void   Finish(byte *hash20);
	String FinishString();
	String FinishStringS();


Mirek
 
Read Message
Read Message
Read Message
Previous Topic: LocalProcess in Core
Next Topic: Problem with DirectoryExists() in windows
Goto Forum:
  


Current Time: Sun Apr 26 16:32:23 GMT+2 2026

Total time taken to generate the page: 0.00465 seconds