refactor(utils): consolidate uppercase hex into toHexUpper

Adds toHexUpper alongside toHex in utils/hex.ts. Routes
group-file's bytesToHexUpper through it so the incoming
msg-push split can share one implementation.
This commit is contained in:
DrSmoothl committed 2026-05-15 14:29:44 +08:00
1 parent 5f88e00135
commit 1a072bc6f1
2 files changed
+12 -1

No files matched your search

@@ -27,6 +27,7 @@ import {
NTV2RichMediaRespSchema,
} from '../proto/oidb-action';
import { FileUploadExtSchema } from '../proto/highway';
import { toHexUpper } from '../../utils/hex';
import { ensureRetCodeZero, resolveSelfUid, toInt, type MediaIndexNode } from './shared';
// ─────────────── public result types ───────────────
@@ -76,7 +77,7 @@ function normalizeDirectory(dir?: string): string {
function bytesToHexUpper(data: unknown): string {
if (!(data instanceof Uint8Array) || data.length === 0) return '';
return Buffer.from(data).toString('hex').toUpperCase();
return toHexUpper(data);
}
function normalizeUploadFileName(name: string, fallback: string): string {