// 前端使用 Web Crypto API (本工具实现方式)
const salt = crypto.getRandomValues(new Uint8Array(16));
const key = await crypto.subtle.importKey('raw', password, 'PBKDF2', false, ['deriveBits']);
const hashBuffer = await crypto.subtle.deriveBits({
name: 'PBKDF2', salt: salt, iterations: 10000, hash: 'SHA-256'
}, key, 256);
const hashBase64 = btoa(String.fromCharCode(...new Uint8Array(hashBuffer)));