Altcha.V2.ChallengeParameters (Altcha v2.3.0)

Copy Markdown View Source

Parameters embedded in a V2 PoW challenge, signed with HMAC. All fields use camelCase when serialized to JSON to match the JS reference implementation.

Summary

Functions

Converts ChallengeParameters to a JSON-encodable map in the wire format. Optional parameters that are nil are omitted.

Types

t()

@type t() :: %Altcha.V2.ChallengeParameters{
  algorithm: String.t(),
  cost: pos_integer(),
  data: map() | nil,
  expires_at: pos_integer() | nil,
  key_length: pos_integer(),
  key_prefix: String.t(),
  key_signature: String.t() | nil,
  memory_cost: pos_integer() | nil,
  nonce: String.t(),
  parallelism: pos_integer() | nil,
  salt: String.t()
}

Functions

to_map(params)

Converts ChallengeParameters to a JSON-encodable map in the wire format. Optional parameters that are nil are omitted.