Skip to content

Instantly share code, notes, and snippets.

@zvlex
Created March 24, 2014 21:43
Show Gist options
  • Save zvlex/9749839 to your computer and use it in GitHub Desktop.
Save zvlex/9749839 to your computer and use it in GitHub Desktop.
Generate SHA256 hash & UUID in Ruby
# Generate SHA256 hash
require 'digest'
Digest::SHA256.hexdigest "your_string"
# Generate UUID
SecureRandom.uuid.split('-').join
@edwardteach42
Copy link

require 'securerandom' is required for the UUID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment