1 files changed, 5 insertions, 0 deletions
diff --git a/src/util/String.ts b/src/util/String.ts
index 3a8e35a8..49fba237 100644
--- a/src/util/String.ts
+++ b/src/util/String.ts
@@ -1,4 +1,5 @@
import { Request } from "express";
+import { ntob } from "./Base64";
import { FieldErrors } from "./instanceOf";
export function checkLength(str: string, min: number, max: number, key: string, req: Request) {
@@ -11,3 +12,7 @@ export function checkLength(str: string, min: number, max: number, key: string,
});
}
}
+
+export function generateCode() {
+ return ntob(Date.now() + Math.randomIntBetween(0, 10000));
+}
|