mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-04 19:35:49 +00:00
Add dotnet-ish Random class
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user