fix(lint): resolve remaining ESLint errors (unused vars, any types, react-refresh)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -78,8 +78,9 @@ export const certificatesApi = {
|
||||
params: tenantParams(tenantId),
|
||||
})
|
||||
return data
|
||||
} catch (err: any) {
|
||||
if (err?.response?.status === 404) return null
|
||||
} catch (err: unknown) {
|
||||
const e = err as { response?: { status?: number } }
|
||||
if (e?.response?.status === 404) return null
|
||||
throw err
|
||||
}
|
||||
},
|
||||
|
||||
@@ -29,7 +29,6 @@ const N_HEX =
|
||||
const N = BigInt('0x' + N_HEX);
|
||||
const g = 2n;
|
||||
const N_BYTES = 256; // 2048 bits = 256 bytes
|
||||
const N_HEX_LEN = N_BYTES * 2; // 512 hex chars
|
||||
|
||||
// ---- Utility Functions ----
|
||||
|
||||
@@ -39,16 +38,6 @@ function toHex(n: bigint): string {
|
||||
return hex;
|
||||
}
|
||||
|
||||
/** Pad a hex string to N's byte length (512 hex chars) with leading zeros. */
|
||||
function padHex(hex: string): string {
|
||||
return hex.padStart(N_HEX_LEN, '0');
|
||||
}
|
||||
|
||||
/** Convert BigInt to padded hex bytes (for hash inputs involving N-sized values). */
|
||||
function bigintToPaddedHex(n: bigint): string {
|
||||
return padHex(toHex(n));
|
||||
}
|
||||
|
||||
/** Convert hex string to Uint8Array. */
|
||||
function hexToBytes(hex: string): Uint8Array {
|
||||
const padded = hex.length % 2 === 1 ? '0' + hex : hex;
|
||||
@@ -93,12 +82,6 @@ function bigintToBytes(n: bigint): Uint8Array {
|
||||
return hexToBytes(toHex(n));
|
||||
}
|
||||
|
||||
/** Hash BigInt values (unpadded, matching srptools int_to_bytes) and return bytes. */
|
||||
async function hashBigInt(...values: bigint[]): Promise<Uint8Array> {
|
||||
const inputs = values.map((v) => bigintToBytes(v));
|
||||
return H(...inputs);
|
||||
}
|
||||
|
||||
/** Pad a BigInt value to N's byte length (256 bytes) matching srptools context.pad(). */
|
||||
function padBigInt(n: bigint): Uint8Array {
|
||||
const bytes = bigintToBytes(n);
|
||||
|
||||
Reference in New Issue
Block a user