diff --git a/spec/awscr-signer/signers/v4_spec.cr b/spec/awscr-signer/signers/v4_spec.cr index 0dc090c..fd4f597 100644 --- a/spec/awscr-signer/signers/v4_spec.cr +++ b/spec/awscr-signer/signers/v4_spec.cr @@ -17,7 +17,7 @@ module Awscr digest = OpenSSL::Digest.new("SHA256") digest.update("BODY") - request.headers["X-Amz-Content-Sha256"].should eq(digest.hexdigest) + request.headers["X-Amz-Content-Sha256"].should eq(digest.final.hexstring) request.headers["Authorization"].should eq("AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150101/us-east-1/s3/aws4_request, SignedHeaders=x-amz-content-sha256;x-amz-date, Signature=791f608d3f2173e73123252f6d3eae407fedbe55d8d62d06fc45bd5ea7584fc0") end end diff --git a/src/awscr-signer/v4/request.cr b/src/awscr-signer/v4/request.cr index 49ce3f2..f309f32 100644 --- a/src/awscr-signer/v4/request.cr +++ b/src/awscr-signer/v4/request.cr @@ -72,7 +72,7 @@ module Awscr end body.rewind - digest.hexdigest + digest.final.hexstring end end diff --git a/src/awscr-signer/v4/signature.cr b/src/awscr-signer/v4/signature.cr index fab33a7..cbe0731 100644 --- a/src/awscr-signer/v4/signature.cr +++ b/src/awscr-signer/v4/signature.cr @@ -52,7 +52,7 @@ module Awscr private def digest digest = OpenSSL::Digest.new("SHA256") digest.update(@string) - digest.hexdigest + digest.final.hexstring end # :nodoc: