Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 14261
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: Mon Jun 09 11:47:23 CEST 2025

Total time taken to generate the page: 0.04549 seconds