To create a SHA512 hash from a string in Ruby, you can use the Digest
class from the Ruby Standard Library. Here's an example:
main.rb128 chars8 lines
This will output the SHA512 hash of the string_to_hash
:
main.rb129 chars2 lines
You can also pass a file instead of a string to calculate the SHA512 hash of that file:
main.rb60 chars2 lines
gistlibby LogSnag