View Source Craftgate.Utils (Craftgate v1.0.42)

Link to this section Summary

Functions

Calculates the signature header based on the given parameters

Returns whether or not a given value is nil or empty

Returns whether or not a given value is not nil and not empty

Generates a random string of given length (default: 16)

Link to this section Functions

Link to this function

calculate_signature(api_key, secret_key, url, random_key, body \\ nil)

View Source
@spec calculate_signature(binary(), binary(), binary(), binary(), term() | nil) ::
  binary()

Calculates the signature header based on the given parameters

@spec is_empty?(any()) :: boolean()

Returns whether or not a given value is nil or empty

@spec non_empty?(any()) :: boolean()

Returns whether or not a given value is not nil and not empty

Link to this function

random_str(length \\ 16)

View Source
@spec random_str(integer() | nil) :: binary()

Generates a random string of given length (default: 16)