Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MD5 VB.NET code
Message
From
27/01/2014 02:25:35
 
 
To
25/01/2014 11:38:04
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01592356
Message ID:
01592432
Views:
57
This message has been marked as a message which has helped to the initial question of the thread.
>>I see - not needed imo
>>
>>And the sample code - I'd use USING instead of Close()
>
>That's what I did. :) Every new implementation of such or when I have time to adjust existing code, I am using the Using approach. This is easier, safer, cleaner and handles the memory related issues better.

And also
(1) Dispose() ( or with using) is never called in the example
SHA256Managed derives from HashAlgorithm http://msdn.microsoft.com/en-us/library/system.security.cryptography.hashalgorithm(v=vs.110).aspx
            SHA256 mySHA256 = SHA256Managed.Create();
(2) Since the property CanReuseTransform returns true http://msdn.microsoft.com/en-us/library/System.Security.Cryptography.SHA256(v=vs.110).aspx
When you need to calculate the hash for a list of files (as per the example) you can instantiate SHA256Managed only once


Same applies to MD5 or anything else deriving from HashAlgorithm
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform