romariolopezc/elm-hmac-sha1/1.0.1

NOTE: the latest version is 3.0.1

Renamed to rlopzc/elm-hmac-sha1. It is published under that name, and new versions come out there.

Versions published as romariolopezc/elm-hmac-sha1 still install under that name. 6 versions of 7 come from the new location (see their notes). 1 version could not be recovered and cannot be installed.

Rerouted (fork, verified). The original repository is gone. This copy comes from a fork that still has the tag. The Lamdera package server serves a copy recovered from https://github.com/Malax/elm-hmac-sha1 (a fork).

What we checked: Rebuilt with git archive from commit 6171acee4099 of https://github.com/Malax/elm-hmac-sha1 (a fork) (zip prefix romariolopezc-elm-hmac-sha1-89ae61b/, America/Los_Angeles times, the tag object 89ae61b8d5db it had before it was re-made, tagger time 2018-12-24 17:46 UTC): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 2e761a8f2ac4bfa4e432366168287789a5b43b2c.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/romariolopezc/elm-hmac-sha1/zipball/1.0.1/

elm-hmac-sha1

Compute HMAC message digests using SHA1 hash function. You provide a key and a message and you get a digest. You can convert the digest into different representations like Bytes, Base16 or Base64.

This provide the native Bytes (elm/bytes). This is important as you can represent the data as you want.

More information of HMAC here.

Examples

Some API's use the HMAC-SHA1 as Authentication, like Amazon or Twitter.

import HmacSha1

canonicalString : String
canonicalString =
  ["application/json", "", "/account", "Wed, 02 Nov 2016 17:26:52 GMT"]
    |> String.join ","

HmacSha1.digest "verify-secret" canonicalString
  |> HmacSha1.toBase64
--> Ok "nLet/JEZG9CRXHScwaQ/na4vsKQ="