diegosouzapw/OmniRoute · error · Error
Invalid Meta AI base62 character
Error message
Invalid Meta AI base62 character: ${char} What it means
decodeMetaAiBase62 iterates the input and throws when a character is not in META_AI_BASE62_ALPHABET — the value being decoded (e.g. a packed conversation id) is malformed or was not produced by the matching encoder.
Solutions
- Check the encoded value was not truncated or hand-modified
- Re-encode with encodeMetaAiBase62 before decoding round-trip inputs
- Validate/normalize the conversation id at the ingestion boundary
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/lib/providers/validation/metaAi.ts:31 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/6cdf4aadee9fc792.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/providers/validation/metaAi.ts:31
export function encodeMetaAiBase62(value: bigint, padLength: number): string {
let remaining = value;
let encoded = "";
while (remaining > 0n) {
encoded = META_AI_BASE62_ALPHABET[Number(remaining % 62n)] + encoded;
remaining /= 62n;
}
return encoded.padStart(padLength, "0");
}
export function decodeMetaAiBase62(value: string): bigint {
let decoded = 0n;
for (const char of value) {
const index = META_AI_BASE62_ALPHABET.indexOf(char);
if (index < 0) {
throw new Error(`Invalid Meta AI base62 character: ${char}`);
}
decoded = decoded * 62n + BigInt(index);
}
return decoded;
}
export function randomMetaAiBigInt(byteLength: number): bigint {
const bytes = new Uint8Array(byteLength);
crypto.getRandomValues(bytes);
let result = 0n;
for (const byte of bytes) {
result = (result << 8n) | BigInt(byte);
}
return result;
}
export function generateMetaAiConversationId(): string {
const timestamp = BigInt(Date.now()) & ((1n << 44n) - 1n);View on GitHub (pinned to a179ffed5b)