Solved

CRC32 Calculation for VB.Net

Posted on 2004-08-16
2
441 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DataGridView Events ? 3 47
SQL syntax in VB.net 5 39
Store results in vb.net 3 22
Database Connections Not being returned to Connection Pool 7 27
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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