User service helpers.
User service helpers.
(build-profile data)
Inputs: [data :- {s/Any s/Any}] Returns: us/Profile
Inputs: [data :- {s/Any s/Any}] Returns: us/Profile
(compare-hash raw encrypted)
Inputs: [raw encrypted] Returns: s/Bool
Compare a raw string with an already encrypted string
Inputs: [raw encrypted] Returns: s/Bool Compare a raw string with an already encrypted string
(deep-merge & xs)
Takes in multiple maps, and returns one merged map, where all nested maps are merged as well.
Takes in multiple maps, and returns one merged map, where all nested maps are merged as well.
(encrypt raw)
(encrypt salt raw)
Inputs: ([salt raw] [raw]) Returns: s/Str
Encrypt the given string with a generated or supplied salt. Uses BCrypt for strong hashing.
Inputs: ([salt raw] [raw]) Returns: s/Str Encrypt the given string with a generated or supplied salt. Uses BCrypt for strong hashing.
(gen-salt)
(gen-salt size)
Inputs: ([size] []) Returns: s/Str
Inputs: ([size] []) Returns: s/Str
(lowercase-equals s1 s2)
Inputs: [s1 :- (s/maybe s/Str) s2 :- (s/maybe s/Str)] Returns: s/Bool
Returns true if both strings are equal (both empty is OK).
Inputs: [s1 :- (s/maybe s/Str) s2 :- (s/maybe s/Str)] Returns: s/Bool Returns true if both strings are equal (both empty is OK).
(random-usernames prefix max)
Inputs: [prefix :- s/Str max :- s/Int]
Don't put an output schema on this! Returns an infinite sequence of usernames created by sticking the prefix onto the beginning of random numbers below the supplied maximum value.
Inputs: [prefix :- s/Str max :- s/Int] Don't put an output schema on this! Returns an infinite sequence of usernames created by sticking the prefix onto the beginning of random numbers below the supplied maximum value.
(select-passing-keys schema m)
Inputs: [schema m]
Selects the keys in the map that pass the given schema.
Inputs: [schema m] Selects the keys in the map that pass the given schema.
(unix-time)
Inputs: [] Returns: UnixTime
Returns the current UnixTime
Inputs: [] Returns: UnixTime Returns the current UnixTime
(username-valid? s)
Inputs: [s :- (s/maybe s/Str)] Returns: s/Bool
Inputs: [s :- (s/maybe s/Str)] Returns: s/Bool
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close