gettingstarted
[Top] [All Lists]

Re: md5 of binary file

To: "Getting Started" <gettingstarted at lists dot realsoftware dot com>
Subject: Re: md5 of binary file
From: "Val Raemaekers" <val at valtronics dot co dot za>
Date: Fri, 29 Apr 2005 15:38:30 +0200
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <007e01c54bf3$ba7345e0$06370ec4 at valxp> <db3758d20f4238ca7520e91712becd09 at mobleybros dot com>
Hi Phil,

Thanks for your help

Working example below :

 Dim f as Folderitem
 Dim result As String
 Dim stream as BinaryStream
 f=GetFolderItem("login.dll")
 If f<>Nil then
   if f.Exists then
     stream=f.openasbinaryFile(False)
     result =  stream.Read(stream.Length)
     stream.close
     MsgBox(MD5(result))
   Else
     MsgBox("File does not exist")
   End if
 End if

Thanks again
Val

----- Original Message ----- From: "Phil M" <phil at mobleybros dot com>
To: "Getting Started" <gettingstarted at lists dot realsoftware dot com>
Sent: Friday, April 29, 2005 3:23 PM
Subject: Re: md5 of binary file


On Apr 28, 2005, at 3:11 PM, Val Raemaekers wrote:

Looking for some sample code to obtain an md5 hash for a binary file stored on disk

Just open the file using BinaryStream, and just write (where b is the BinaryStream instance):

  hashstring = MD5(b.Read(b.Length))

Just look up BinaryStream and FolderItem in the Language Reference if you need help getting the BinaryStream setup.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.10.4 - Release Date: 2005/04/27


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>