Skip to content

Instantly share code, notes, and snippets.

@zouchao
Created August 6, 2018 06:01
Show Gist options
  • Save zouchao/532077cc3710fd314f6a41659bab3a3d to your computer and use it in GitHub Desktop.
Save zouchao/532077cc3710fd314f6a41659bab3a3d to your computer and use it in GitHub Desktop.
# Generate SHA256 hash
require 'digest'
Digest::SHA256.hexdigest "your_string"
# Generate MD5
require 'digest/md5'
Digest::MD5.hexdigest "your_string"
# Generate UUID
SecureRandom.uuid.split('-').join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment