feat(kms): sign & verify data

This commit is contained in:
Daniel Hougaard
2025-04-03 07:17:29 +04:00
parent ebcf4761b6
commit c6ca668db9
36 changed files with 1873 additions and 162 deletions
+14
View File
@@ -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);
};