Liking cljdoc? Tell your friends :D

altcha-clj.core


ab2hexclj/s≠

clj
(ab2hex byte-array)

Converts a byte array to a hexadecimal string

Converts a byte array to a hexadecimal string
cljs
(ab2hex array-buffer)
source (clj)source (cljs)raw docstring

create-challengeclj/s

(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 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
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 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
sourceraw docstring

createChallengecljs

(createChallenge options)
source

default-algclj/s

source

default-max-numberclj/s

source

default-salt-lenclj/s

source

hash-hexclj/s≠

clj
(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
cljs
(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
source (clj)source (cljs)raw docstring

hmac-hexclj/s≠

(hmac-hex algorithm data key)
clj

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'
source (clj)source (cljs)raw docstring

random-bytesclj/s

(random-bytes n)
source (clj)source (cljs)

random-intclj/s

(random-int max)
source (clj)source (cljs)

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close