Solved

CRC32 Calculation for VB.Net

Posted on 2004-08-16
2
442 Views
Last Modified: 2008-01-16
Hi!

I need to compare 2 sets of odd data.  I figure a CRC32 check should do the trick.  How?

I've looked at a lot of 3rd party components and I just need something simple like:

MyCRC32 = GetCRC32(Mydata as String)

All I seem to find are mammoth applications with a ton of extra crap.  I don't want to browse for files, set up timers (???) etc.  Just a simple CRC32/MD5/Whatever routine to generate a checksum for a string value.

The simplest solution gets the points.
0
Comment
Question by:MIKEV
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 250 total points
ID: 11814564
 Public Function ComputeMD5Hash(ByVal inputString As String) As String

    Dim md5Provider As New System.Security.Cryptography.MD5CryptoServiceProvider

    Dim bytesInput() As Byte = System.Text.UTF8Encoding.UTF8.GetBytes(inputString)

    Dim bytesHash() As Byte = md5Provider.ComputeHash(bytesInput)

    Return System.Text.UTF8Encoding.UTF8.GetString(bytesHash)

  End Function 'ComputeMD5Hash'

Bob
0
 

Author Comment

by:MIKEV
ID: 11814657
Excellent Bob, as always. :)  Thanks.
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question