Skip to content

Instantly share code, notes, and snippets.

@rlb3
Forked from bentonporter/gist:2891463
Last active August 29, 2015 14:17
Show Gist options
  • Save rlb3/288890cf10ec9bc6b757 to your computer and use it in GitHub Desktop.
Save rlb3/288890cf10ec9bc6b757 to your computer and use it in GitHub Desktop.
require 'openssl'
require 'Base64'
key = "secret-key"
data = "some data to be signed"
Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha256'), key, data)).strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment