(ab2hex byte-array)
Converts a byte array to a hexadecimal string
Converts a byte array to a hexadecimal string
(ab2hex array-buffer)
(create-challenge options)
Creates a challenge for the client to solve. options is a map of the following keys:
:algorithm
- algorithm for creating a digest of the challenge, default is SHA-256.
For ClojureScript, it will always be SHA-256.
Can also be SHA-1 or SHA-512:max-number
- highest random number used for generating the challenge. Default is 1e6:salt-len
- length of the salt. Default is 12:expires
- optional, recommended. Expiration time of the challenge validity in seconds.:hmac-key
- required, the secret key for creating the HMAC signature (a string value, not a path):params
- optional, additional parameters to include in the saltChanging the following parameters to hardcoded values is not recommended outside development settings
:salt
- optional, custom salt to use instead of generating one:number
- optional, custom number to use instead of generating oneCreates a challenge for the client to solve. options is a map of the following keys: - `:algorithm` - algorithm for creating a digest of the challenge, default is **SHA-256**. For ClojureScript, it will always be SHA-256. Can also be **SHA-1** or **SHA-512** - `:max-number` - highest random number used for generating the challenge. Default is 1e6 - `:salt-len` - length of the salt. Default is 12 - `:expires` - optional, recommended. Expiration time of the challenge validity in seconds. - `:hmac-key` - required, the secret key for creating the HMAC signature (a string value, not a path) - `:params` - optional, additional parameters to include in the salt Changing the following parameters to hardcoded values is not recommended outside development settings - `:salt` - optional, custom salt to use instead of generating one - `:number` - optional, custom number to use instead of generating one
(hash-hex algorithm data)
Generates a hexadecimal string representation of the challenge message digest created using the selected algorithm
Generates a hexadecimal string representation of the challenge message digest created using the selected algorithm
(hash-hex _ data)
Generates a hexadecimal string representation of the SHA-256 digest of the challenge message
Generates a hexadecimal string representation of the SHA-256 digest of the challenge message
(hmac-hex algorithm data key)
Returns the HMAC-encoded value of the data. Params
algorithm
- 'SHA-256', 'SHA-512' or 'SHA-1'Returns the HMAC-encoded value of the data. Params - `algorithm` - 'SHA-256', 'SHA-512' or 'SHA-1'
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close