Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Add hashing methods to String class
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
test hashsum-2.1.4.gem
.gitignore
.travis.yml
README.md
Rakefile
hashsum.gemspec

README.md

Hashsum Build Status Gem Version

Install

gem install hashsum

Algorithms

  • MD5
  • SHA1
  • SHA2
    • SHA256
    • SHA384
    • SHA512

Usage

"String to Hash".hashsum(:md5)              # "eda58b412d6e55a2eebb5b5f731330bd"
"String to Hash".hashsum(:md5, "with Salt") # "4fb893fcf815198c0905e59d6685b5ec"
"String to Hash".to_md5                     # "eda58b412d6e55a2eebb5b5f731330bd"
"String to Hash".to_sha1                    # "2bcea1ad0b1afe203aa12c470bdf545df9ef5dfd"
"String to Hash".to_md5("with Salt")        # "4fb893fcf815198c0905e59d6685b5ec"
"String to Hash".to_sha1("with Salt")       # "d16dbd40354fe3b418da952e648f4eca37e05a78"

Executable

$ hashsum foo
0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33 foo
$ hashsum foo bar
0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33 foo
62cdb7020ff920e5aa642c3d4066950dd1f01f4d bar
$ hashsum foo bar -a md5
acbd18db4cc2f85cedef654fccc4a4d8 foo
37b51d194a7513e45b56f6524f2d51f2 bar

For more see

$ hashsum -h

Author

@fraskyrusso

License

This gem is published under MIT and GPL

Something went wrong with that request. Please try again.