Packages

CaptainHook signature. It follows the Stripe’s specification about signature.

Current section

5 Versions

Jump to

Compare versions

4 files changed
+4 additions
-4 deletions
  @@ -14,7 +14,7 @@ The package can be installed by adding `captain_hook_signature` to your list of
14 14 ```elixir
15 15 def deps do
16 16 [
17 - {:captain_hook_signature, "~> 0.3.0"}
17 + {:captain_hook_signature, "~> 0.4.0"}
18 18 ]
19 19 end
20 20 ```
  @@ -30,4 +30,4 @@
30 30 {<<"optional">>,false},
31 31 {<<"repository">>,<<"hexpm">>},
32 32 {<<"requirement">>,<<"~> 1.1">>}]]}.
33 - {<<"version">>,<<"0.3.0">>}.
33 + {<<"version">>,<<"0.4.0">>}.
  @@ -43,7 +43,7 @@ defmodule CaptainHookSignature do
43 43 end
44 44
45 45 defp hash(payload, timestamp, secret) do
46 - :crypto.hmac(:sha256, secret, "#{timestamp}.#{payload}")
46 + :crypto.mac(:hmac, :sha256, secret, "#{timestamp}.#{payload}")
47 47 |> Base.encode16(case: :lower)
48 48 end
  @@ -2,7 +2,7 @@ defmodule CaptainHookSignature.MixProject do
2 2 use Mix.Project
3 3
4 4 @source_url "https://github.com/annatel/captain_hook_signature"
5 - @version "0.3.0"
5 + @version "0.4.0"
6 6
7 7 def project do
8 8 [