status-mobile/src/utils/validators.cljs
2023-04-26 18:14:14 +02:00

15 lines
290 B
Clojure

(ns utils.validators)
(defn valid-public-key?
[s]
(and (string? s)
(not-empty s)
(boolean (re-matches #"0x04[0-9a-f]{128}" s))))
(defn valid-compressed-key?
[s]
(and (string? s)
(not-empty s)
(boolean (re-matches #"^zQ3[0-9A-HJ-NP-Za-km-z]{46}" s))))