Created
October 28, 2018 01:27
-
-
Save geetfun/8c76727e854f866a9fd64a8fc0fdc56b to your computer and use it in GitHub Desktop.
Generate hmac comparison
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
calculated_hmac = Base64.strict_encode64(OpenSSL::HMAC.digest('sha256', SHARED_SECRET, data)) | |
ActiveSupport::SecurityUtils.secure_compare(calculated_hmac, hmac_header) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment