Skip to content

Instantly share code, notes, and snippets.

@wtn
Forked from bentonporter/gist:2891463
Created December 9, 2014 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wtn/f3ab10344914e4efa7f6 to your computer and use it in GitHub Desktop.
Save wtn/f3ab10344914e4efa7f6 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.new('sha256'), key, data)).strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment