biocodenv.com

  • Increase font size
  • Default font size
  • Decrease font size
Welcome to the Frontpage

Ruby: MD5 and SHA256 Hash

E-mail Print PDF

Tired of always coding a quick MD5 or SHA256 hash digest code to run checksums, I finally coded this really simple script in Ruby. Then, to make it easier to run, I generated a windows batch file that takes an input file and returns the MD5 and SHA256 checksums.

To run the batch file, just run:

D:\> md5_sha256 .\ruby_code\security_hash\test.txt
SHA256 Digest: b31be10c867258146b4b10409fa6ffd46e5e196b7a4f9d11c0c354903cafdaa1
MD5 Digest: 3e09efe7694c40db6ad990f9d7d8e786

I've zipped up the project files (includes the Ruby script, the windows batch file, the test text file used above, and my unit testing code (in the directory called test)). And the MD5 and SHA256 checksums are:

MD5 Digest: 0f31140686af1e03e1c1a5a87e7174a0

SHA256 Digest: ff3415bd1fa6b0ca53adabbd6af5b33b8c1d6edf5bc5630491b31c5c94c96f70

 

If you have questions, or want more information about this code, see my blog post.

Last Updated on Friday, 18 December 2009 04:33
 

About Biocodenv

E-mail Print PDF

Biocodenv is a site I created to host and disseminate my open source code projects. This is also where I blog about the development of these projects, and occassionally on bioinformatics and biological research. Most of my software coding is done in Ruby, Python, or PHP, although I also code in Flex, AIR, and Java -- depends on the project.

I'm currently working on software within these areas:

  • Electronic Lab Notebooks
  • Pattern Recognition/Data Mining/Machine Learning
  • High Performance Computing
  • Mathematical Modeling
  • Cis-regulatory Element Prediction
  • Statistical modeling and analysis
  • Data Integration
  • Semantic Web

 

 

Polls

Who's Online

We have 1 guest online