Last active
May 5, 2016 14:37
-
-
Save jamesduncombe/e5bedd76673feed560c365e0dbc2444c to your computer and use it in GitHub Desktop.
Function for generating the API signature for Vaultoro's API - https://api.vaultoro.com
This file contains 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
defmodule Vaultoro do | |
@doc """ | |
secret = The Vaultoro secret generated along with your API key | |
endpoint = The full URL that you are requesting (with all params) e.g: https://api.vaultoro.com/1/balance?nonce=9&apikey=_MY_API_KEY_ | |
""" | |
def signature(secret, endpoint) do | |
:crypto.hmac(:sha256, secret, endpoint) | |
|> Base.encode16(case: :lower) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment