From 7d2fd7b4f8d5ab7e27bfbea6a4498edbbaf7df9c Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 3 Oct 2025 20:29:32 +0200 Subject: Add dotnet-ish Random class --- src/api/util/utility/String.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/api') diff --git a/src/api/util/utility/String.ts b/src/api/util/utility/String.ts index eef69e39..348f33cf 100644 --- a/src/api/util/utility/String.ts +++ b/src/api/util/utility/String.ts @@ -18,7 +18,7 @@ import { Request } from "express"; import { ntob } from "./Base64"; -import { FieldErrors } from "@spacebar/util"; +import { FieldErrors, Random } from "@spacebar/util"; export function checkLength( str: string, @@ -40,5 +40,5 @@ export function checkLength( } export function generateCode() { - return ntob(Date.now() + Math.randomIntBetween(0, 10000)); + return ntob(Date.now() + Random.nextInt(0, 10000)); } -- cgit 1.5.1