I couldnt find any. can someone help me?
Printable View
I couldnt find any. can someone help me?
got it lock pl0x
Here is a sample by CVMichael.
In case anyone stumbles across here, this is the one I use 'cause it's fast, works, and doesn't require DLLs or anything.
http://www.pscode.com/vb/scripts/Sho...65445&lngWId=1
I haven't checked out CVMichael's.
There is also the one built into Windows, which can be used via API calls or via the Crypto API Component (CAPICOM). It offers MD5, SHA1, and many other hash algorithms as well as several styles of encryption and also Base64 encoding/decoding.
Is that for NT only?
Just like to add a word about MD5 for Files.
I was downloading files that included a MD5 hash number so you could check the download and none of those VB6 classes I tried were 100% accurate, I mean they all seemed to work but sooner or later they would all return a wrong MD5 number making you think the download was bad when it wasn't.
I ended up using this one for checking files, though it has some file size limits it is really fast and was accurate everytime.
Grab file MD5 quickly
btw, never tried CVMichael's
Win95 OSR2 and later.Quote:
Originally Posted by DigiRev
Oh cool. Any chance you can post a link or some code?Quote:
Originally Posted by dilettante
Edgemeal - I was worried about that also but have compared the one I linked to, to PHP's md5() function and in every case (so far) it has returned the correct results. I use it mainly for strings though and not large files.
Edit: That one looks better and from description might be using the API's dil is talking about.
It is also worth asking what one means when requesting "String to MD5" since MD5 is only defined over a byte stream.
VB Strings are UTF-16 and without care arbitrary and implicit conversions to ANSI can distort things. You really need to make a conscious decision about your conversions or be sure to hash the Unicode values.
Because of this many attempts to write MD5 hash routines in VB6 will fail in places due to unexpected distortions. Anyone's MD5 using Strings internally should be considered dicey.
I can probably convert an SHA1 sample I have here pretty quickly.Quote:
Originally Posted by DigiRev
Using CAPICOM is much less code, but I won't assume everyone wants the extra dependency.
Always better without the dependency. Maybe make a post in the CodeBank if you get the chance? Would be cool to have that in there...
Posted as [VB6] CryptoAPI MD5 Hash.
Verified hash of ANSI-converted string against Free online md5 hash calculator.