Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CRC32 Calculation for VB.Net

Posted on 2004-08-16
2
Medium Priority
?
448 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

722 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