Skip to content

Commit d303d8a

Browse files
fix(usage): use secure random longitude (#3839)
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
1 parent d41a78a commit d303d8a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/web/src/scripts/usage/benchmark-insert-usage.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { cpus } from 'os';
2-
import { randomUUID } from 'crypto';
2+
import { randomInt as secureRandomInt, randomUUID } from 'crypto';
33
import { Worker } from 'worker_threads';
44
import path from 'path';
55
import { closeAllDrizzleConnections, db } from '@/lib/drizzle';
@@ -142,7 +142,7 @@ function generateRandomRecord(
142142
metaStats.vercel_ip_latitude_null_pct
143143
),
144144
http_x_vercel_ip_longitude: maybeNull(
145-
Math.random() * 360 - 180,
145+
secureRandomInt(0, 360_000_000) / 1_000_000 - 180,
146146
metaStats.vercel_ip_longitude_null_pct
147147
),
148148
http_x_vercel_ja4_digest: maybeNull(

0 commit comments

Comments
 (0)