summary refs log tree commit diff
path: root/src/util/String.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-07 20:03:24 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-07 20:03:24 +0200
commit78fa2835abe7ff49995ad82bd28dbb956375b875 (patch)
tree9a1db5eab693c81e01743caa60a2050c3b018dee /src/util/String.ts
parent[Route] PATCH /guilds/:id/roles (diff)
downloadserver-78fa2835abe7ff49995ad82bd28dbb956375b875.tar.xz
:art: [Route] templates refactor
Diffstat (limited to 'src/util/String.ts')
-rw-r--r--src/util/String.ts5
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)); +}