const DEMO_BEARER_TOKEN = 'demo-token-123';

export async function sha256Hex(data: string): Promise<string> {
  const hashBuffer = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(data));
  return Array.from(new Uint8Array(hashBuffer))
    .map((value) => value.toString(16).padStart(2, '0'))
    .join('');
}

export async function buildAuthHeaders(
  _method: string,
  _path: string,
  _body: string
): Promise<Record<string, string>> {
  return {
    Authorization: `Bearer ${DEMO_BEARER_TOKEN}`,
  };
}
