Solved

CRC32 Calculation for VB.Net

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now