Send hotlink access token hash on upload; keep secret client-side only.

This commit is contained in:
2026-11-02 01:46:51 +01:00
parent 0ef4993ad9
commit 2396c5d16d
6 changed files with 94 additions and 4 deletions
@@ -0,0 +1,9 @@
export const hashHotlinkAccessToken = async (accessToken: string): Promise<string> => {
const encoder = new TextEncoder();
const data = encoder.encode(accessToken);
const digest = await crypto.subtle.digest('SHA-256', data);
return [...new Uint8Array(digest)].map(byte => byte.toString(16).padStart(2, '0')).join('');
};