Generating Hash Value for a DLL File in Visual Studio Commuity 2019

Hussnain Javed

New member
Joined
Sep 1, 2021
Messages
2
Programming Experience
Beginner
Hi, how are you all? Hope you're all fine. I'm looking for a way to get hash value of a dll file which I've created in a class library's project in visual studio community 2019.

I've only one 1 class in my project and I need only dll file and hash value. As I can't run the Project but I can only build the project. Bulding the project I got dll file but now I don't know how to get the hash value of that dll. Can anyone please help me in generating hash value for that dll file?

Thanks for reading.
 
Are you asking how to write C# code to generate a hash from a file? If so what hash algorithm? What do you not understand about existing examples you fo

Are you asking how to write C# code to generate a hash from a file? If so what hash algorithm? What do you not understand about existing examples you found?
Hi Jmcilhinney, thanks for replying.

Algorithm : SHA256

Below is an example of hash values of some DLLs:

"System.IO.Compression.dll": "sha256-hLbkXBzxUk9DSXYTLGRowe+80rxmpXsqEZbPIL4+5zs=",
"System.Drawing.Common.dll": "sha256-vcCLMX4xAsUqKuQjjIkzu1O9pHGO\/tdvysgSmEjL6oo=",
"System.Data.DataSetExtensions.dll": "sha256-eejp4oI3sQBq\/tI6GsJNaPu3Dkdot5Vbn8+R3w2vYLE=",
"System.Data.dll": "sha256-dxfTuT6ffPMmvuUUTfv7+bpLtOZZZHQdz77hjhy9qHw=",
"System.Numerics.Vectors.dll": "sha256-qAKfFnquY+7UC\/MzLi04rjqEhLzTryCoLg\/S6MxI19I=",
"System.Text.Encodings.Web.dll": "sha256-Tqh1Da+iTRQJEZUGAsMNFuZ4hf1PMf13WApRZod+uw4=",
"Microsoft.Extensions.DependencyInjection.Abstractions.dll": "sha256-Bs1Wrmh4ex9dTEIT0yCRF52N\/wOmsBDt457BHr0\/ssM=",
"TestLib.dll": "sha256-O27cm578dykjOstX+PUD7KQoV6QLq0SlX2TAc+HCnbw=",
"MathematicalExpression.dll": "",

I created a class library's project named "MathematicalExpression". Building this project I'm getting a dll file but I also want a hash value for my dll (MathematicalExpression.dll) like above DLLs' hash value. Photo of my Class library's project is also attached.

Now can you pelase help me in getting such a hash value for my dll (MathematicalExpression.dll)?
 

Attachments

  • bbbb.jpg
    bbbb.jpg
    110.4 KB · Views: 71
Last edited:
Let's step back. Where did you find/get that list of DLLs and hash values?
 
I'm not sure whether you understand how hashing works. Hashing is done on binary data and it provides a small "signature" for arbitrarily large blocks of data. If you want to generate a hash for a file, go ahead. Simply read the data and generate its hash in the same way you would any other data. Again, what do you not understand about the existing examples of creating a hash in C# when you looked for yourself? When I searched for "c# sha256 hash" the very first result included example code. Did you do that? If not, why not? If you have done what you can and have encountered a specific issue, tell us what that issue is. If you haven't made any effort on your own behalf yet, you should do that first. We're here to help but help implies that you do your share. We generally don't just write people's code for them.
 
Below is an example of hash values of some DLLs:

"System.IO.Compression.dll": "sha256-hLbkXBzxUk9DSXYTLGRowe+80rxmpXsqEZbPIL4+5zs=",
"System.Drawing.Common.dll": "sha256-vcCLMX4xAsUqKuQjjIkzu1O9pHGO\/tdvysgSmEjL6oo=",
"System.Data.DataSetExtensions.dll": "sha256-eejp4oI3sQBq\/tI6GsJNaPu3Dkdot5Vbn8+R3w2vYLE=",
"System.Data.dll": "sha256-dxfTuT6ffPMmvuUUTfv7+bpLtOZZZHQdz77hjhy9qHw=",
"System.Numerics.Vectors.dll": "sha256-qAKfFnquY+7UC\/MzLi04rjqEhLzTryCoLg\/S6MxI19I=",
"System.Text.Encodings.Web.dll": "sha256-Tqh1Da+iTRQJEZUGAsMNFuZ4hf1PMf13WApRZod+uw4=",
"Microsoft.Extensions.DependencyInjection.Abstractions.dll": "sha256-Bs1Wrmh4ex9dTEIT0yCRF52N\/wOmsBDt457BHr0\/ssM=",
"TestLib.dll": "sha256-O27cm578dykjOstX+PUD7KQoV6QLq0SlX2TAc+HCnbw=",
"MathematicalExpression.dll": "",
Actually, I'm with Skydiver. Where exactly did that list come from? It seems like maybe you aren't actually asking for code to calculate a has but rather you just expect a hash to appear somewhere specific but you don't feel the need to actually explain where that is. Please provide a FULL and CLEAR explanation of the problem. "I want a hash" is not that.
 
Back
Top Bottom