refactor: don't expose randomHex, it's an internal fn, just inline again for now until I fix things up

This commit is contained in:
zk
2026-07-12 12:09:03 +00:00
parent cf6ea3c019
commit ee40f099ee
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
export function randomHex(byteLength: number): string {
function randomHex(byteLength: number): string {
const buf = new Uint8Array(byteLength);
globalThis.crypto.getRandomValues(buf);
@@ -16,12 +16,17 @@ import {
CreateChartID,
CreateSongID,
GetFreshSongIDGenerator,
randomHex,
ReadCollection,
WriteCollection,
} from "../../../util";
import { ParseIIDXData } from "./convert";
function randomHex(bytes: any) {
const buf = new Uint8Array(bytes);
globalThis.crypto.getRandomValues(buf);
return Array.from(buf, (b) => b.toString(16).padStart(2, "0")).join("");
}
if (require.main !== module) {
throw new Error(`This is a script. It should be ran directly from the command line with bun.`);
}
-2
View File
@@ -9,7 +9,6 @@ import {
CreateQuestID,
CreateSongID,
CreateTableID,
randomHex,
} from "tachi-common";
import DeterministicCollectionSort from "./sort-seeds.js";
@@ -136,5 +135,4 @@ export {
CreateSongID,
CreateTableID,
GetSongCollectionGameGroup as GetSongCollectionGame,
randomHex,
};