mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Moves the repeatedly defined HEX64_REGEX constant to a shared utility module to improve maintainability and consistency. Updates all consumers to import from the new location. Signed-off-by: Jules <[email protected]> Co-authored-by: PR0M3TH3AN <[email protected]>
14 lines
332 B
JavaScript
14 lines
332 B
JavaScript
export const HEX64_REGEX = /^[0-9a-f]{64}$/i;
|
|
|
|
export function normalizeHexString(value) {
|
|
if (typeof value !== "string") {
|
|
return "";
|
|
}
|
|
|
|
const trimmed = value.trim();
|
|
return trimmed ? trimmed.toLowerCase() : "";
|
|
}
|
|
|
|
export const normalizeHexId = normalizeHexString;
|
|
export const normalizeHexPubkey = normalizeHexString;
|