mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 08:26:00 +00:00
feat(kms): sign & verify data
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
const base64WithPadding =
|
||||
/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$/;
|
||||
|
||||
export const isBase64 = (str: string): boolean => {
|
||||
if (typeof str !== "string") {
|
||||
throw new TypeError("Expected a string");
|
||||
}
|
||||
|
||||
if (str === "") return true;
|
||||
|
||||
const regex = base64WithPadding;
|
||||
|
||||
return regex.test(str);
|
||||
};
|
||||
Reference in New Issue
Block a user