Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to Xbox Chaos: Modding Evolved

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

OrangeMohawk

C#
Simple Hash Checker

6 posts in this topic

Hey guys! I'm learning C#, and I made a simple program that will do hash checks of MD5, SHA1, SHA256, SHA384, and SHA512 on a file. Now this is my first program in C#, so criticism would be appreciated, but don't be too harsh :tongue:

 

With my most recent update, the program now offers drag-and-drop functionality. I only updated the source, no release yet as I feel a few things need to be fixed up before I do another release. I will most likely come back and add more features that would help the program when I understand them more.

 

9832595173_bf0a035e28_o.png

the idle screen

 

9832518725_3e74a14c60_o.png

checking some boxes, then opening a file will return the hashes you have checked

 

9832532586_9fb17871d1_o.png

changing the boxes that are checked, then clicking "Get Hashes!" will calculate the hashes that are checked for the opened file

 

 

View on GitHub

 

The code is commented as needed. Enjoy!

 

Original Post:


Anyways, here's some pics:

9821820053_92e3cc68b3_o.png
when you first open the program
 
9821761566_c2b45692fe_o.png
when a file is opened

Now, when I was first making this, I wanted to have some additional features, including the ability to drag a file onto the form and have it opened, a progress bar for those larger files that take some time to load, and buttons to do each hash individually, in case you don't need all five hashes. I may come back and revise this when I understand how to implement those a bit more.

 

Download (Program + Source)

 

I don't have the source commented, just cause I was so excited to get my program working. If anyone learning C# would like me comment the source and explain what does what, I will be happy to.

Edited by OrangeMohawk
0xdeafcafe, Akarias, Lehvak and 1 other like this

Share this post


Link to post
Share on other sites

-snip-

I haven't taken a look at your code(you should use source control, even for simple projects). You said you commented the code a lot. While this is good for example scripts used for other people, but just because it's open source doesn't mean you have to overly comment it. Only comment what's necessary. 

AMD likes this

Share this post


Link to post
Share on other sites

I haven't taken a look at your code(you should use source control, even for simple projects). You said you commented the code a lot. While this is good for example scripts used for other people, but just because it's open source doesn't mean you have to overly comment it. Only comment what's necessary. 

Thanks for the input! For the source control I'll probably try and use github, as I already have an account. As for the commenting, I think at this stage of my learning it's a good idea, in case I need to come back and look at the code for a future project. As I learn more though, I'll probably do what you said and only comment what's necessary.

 

Edit: Pushed to GitHub, link updated

Edited by OrangeMohawk

Share this post


Link to post
Share on other sites

Thanks for the input! For the source control I'll probably try and use github, as I already have an account. As for the commenting, I think at this stage of my learning it's a good idea, in case I need to come back and look at the code for a future project. As I learn more though, I'll probably do what you said and only comment what's necessary.

 

Edit: Pushed to GitHub, link updated

The reason I recommend little comments is because typically, if the code is good, it should explain itself. And yeah, GitHub is good, it's what I use. 

OrangeMohawk likes this

Share this post


Link to post
Share on other sites

The reason I recommend little comments is because typically, if the code is good, it should explain itself. And yeah, GitHub is good, it's what I use. 

 

This. If you organize your code well, you won't need (too many) comments.

 

For example, instead of doing (I haven't looked at your source code yet or anything, this is just me making up some stuff on the spot):

 

// Calculate the MD5line 1...line 2...line 3... // Calculate the SHA-1line 1...line 2...line 3... // Calculate the SHA-256line 1...line 2...line 3...

You can do:

CalculateMD5();CalculateSHA1();CalculateSHA256();...private void CalculateMD5(){    line 1...    line 2...    line 3...} private void CalculateSHA1(){    line 1...    line 2...    line 3...} private void CalculateSHA256(){    line 1...    line 2...    line 3...}

No comments (unless you want to add XML documentation for your methods), and your code is also more modular as a plus.

OrangeMohawk and Fierce Waffle like this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now