i have write it in vb
but it stil is diferent from CRC32
Is posible to convert hash to CRC32 ??
Regards
Paul
---------------Code
Function crc(ByVal file_name As String) As String
Dim file As System.IO.FileStream
Dim Sha1T As SHA1CryptoServiceProvider
Dim HASH
Dim BUFF As New StringBuilder
Dim hashByte As Byte
file = New FileStream(file_name, FileMode.Open, FileAccess.Read,
FileShare.Read, 8192)
Sha1T = New SHA1CryptoServiceProvider()
Sha1T.ComputeHash(file)
HASH = Sha1T.Hash
For Each hashByte In HASH
BUFF.Append(String.Format("{0:X1}", hashByte))
Next
Return BUFF.ToString()
End Function
Looks to me as if you grabbed the code from the section at
the bottom titled "Other Hash Algorithms", which does not have
anything to do with calculating CRC32.
Download the crc32.zip file and unzip it for the full CRC32 source
example.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.