Created
June 10, 2022 06:34
-
-
Save moreta/6d0ed046f68ac3a47d52284e4333af08 to your computer and use it in GitHub Desktop.
channel talk HMAC Hashing ruby
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
member_id = 'lucas'; | |
secret_key = '4629de5def93d6a2abea6afa9bd5476d9c6cbc04223f9a2f7e517b535dde3e25'; | |
expected_hash = "99427c7bba36a6902c5fd6383f2fb0214d19b81023296b4bd6b9e024836afea2"; | |
key = ['4629de5def93d6a2abea6afa9bd5476d9c6cbc04223f9a2f7e517b535dde3e25'].pack('H*') | |
OpenSSL::HMAC.hexdigest("SHA256", key, member_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment