Você está na página 1de 1

Function para Criptografar em Md5

Obs : para que essa function possa funcioanar precisa ter : unit Wcrypt2.pas. http://stuff.irsoft.de/CryptoAPI2.zip nesse link aci a te Wicrypt2.pas para do!nload

function "#or $. d%&const Input: String': String( var hCryptPro)ider: *C+,P"P+O-( h*ash: *C+,P"*A.*( b*ash: array/0..12f3 of 4yte( d!*ash5en: 6WO+6( pbContent: P4yte( i: Inte7er( begin d!*ash5en :8 $9( pbContent :8 Pointer&PChar&Input''( +esult :8 ::( if CryptAcquireConte;t&<hCryptPro)ider= nil= nil= P+O->+.A>#?55= C+,P">-@+I#,COA"@B" or C+,P">CAC*IA@>D@,.@"' then begin if CryptCreate*ash&hCryptPro)ider= CA5E>C6%= 0= 0= <h*ash' then begin if Crypt*ash6ata&h*ash= pbContent= 5en7th&Input'= 0' then begin if CryptEet*ashPara &h*ash= *P>*A.*-A5= <b*ash/03= <d!*ash5en= 0' then begin for i :8 0 to d!*ash5en F $ do begin +esult :8 +esult G #or at&:H.2;:= /b*ash/i33'( end; end; end; Crypt6estroy*ash&h*ash'( end( Crypt+eleaseConte;t&hCryptPro)ider= 0'( end( +esult :8 Ansi5o!erCase&+esult'( end(

Você também pode gostar