Hi
I am trying to get the hash for a file. I know how to get the inputstream for the file and how to calculate the hash from the bytes. I just dont know ow to get the bytes from the inputstream/file?
Sub OpenFile(dir As String, filename As String)
Dim in As InputStream
in = File.OpenInput(dir,filename)
Dim buffer(1024) As Byte
'count = in.ReadBytes(buffer, 0, buffer.length)
Dim Bconv As ByteConverter
Dim data(0) As Byte
Dim md As MessageDigest
'data = Bconv.StringToBytes(msg, "UTF8")
data = md.GetMessageDigest(data, "MD5")
Msgbox(Bconv.HexFromBytes(data), "MD5 digest")
End Sub
Thanks
Scott
I am trying to get the hash for a file. I know how to get the inputstream for the file and how to calculate the hash from the bytes. I just dont know ow to get the bytes from the inputstream/file?
Sub OpenFile(dir As String, filename As String)
Dim in As InputStream
in = File.OpenInput(dir,filename)
Dim buffer(1024) As Byte
'count = in.ReadBytes(buffer, 0, buffer.length)
Dim Bconv As ByteConverter
Dim data(0) As Byte
Dim md As MessageDigest
'data = Bconv.StringToBytes(msg, "UTF8")
data = md.GetMessageDigest(data, "MD5")
Msgbox(Bconv.HexFromBytes(data), "MD5 digest")
End Sub
Thanks
Scott