-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #17869 Signed-off-by: yqrashawn <namy.19@gmail.com>
- Loading branch information
Showing
4 changed files
with
49 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
(ns utils.validators) | ||
(ns utils.validators | ||
(:require | ||
[status-im2.constants :as constants])) | ||
|
||
(defn valid-public-key? | ||
[s] | ||
(and (string? s) | ||
(not-empty s) | ||
(boolean (re-matches #"0x04[0-9a-f]{128}" s)))) | ||
(boolean (re-matches constants/regx-public-key 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)))) | ||
|
||
(boolean (re-matches constants/regx-compressed-key s)))) |