From 78fa2835abe7ff49995ad82bd28dbb956375b875 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Fri, 7 May 2021 20:03:24 +0200 Subject: :art: [Route] templates refactor --- src/util/String.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/util/String.ts') 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)); +} -- cgit 1.5.1