Skip to content

Commit a40f8d7

Browse files
aedryananakinj
authored andcommitted
chore: use correct arguments for custom algo example
1 parent 3d0a573 commit a40f8d7

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
**Fixes and enhancements:**
1212

13+
- Updated README to correctly document `OpenSSL::HMAC` documentation [#617](https://github.com/jwt/ruby-jwt/pull/617) ([@aedryan](https://github.com/aedryan))
1314
- Your contribution here
1415

1516
## [v2.9.1](https://github.com/jwt/ruby-jwt/tree/v2.9.1) (2024-09-23)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ module CustomHS512Algorithm
240240
end
241241

242242
def self.sign(data:, signing_key:)
243-
OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha512'), data, signing_key)
243+
OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha512'), signing_key, data)
244244
end
245245

246246
def self.verify(data:, signature:, verification_key:)

spec/integration/readme_examples_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def self.alg
458458
end
459459

460460
def self.sign(data:, signing_key:)
461-
OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha512'), data, signing_key)
461+
OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha512'), signing_key, data)
462462
end
463463

464464
def self.verify(data:, signature:, verification_key:)

0 commit comments

Comments
 (0)