mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-07 22:38:02 +03:00
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:
@@ -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.`);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user