refactor: improve type safety, Svelte 5 reactivity, and API resilience
This commit is contained in:
@@ -96,7 +96,8 @@ export const split_iv_and_base64 = function split_iv_and_base64(combined: string
|
||||
}
|
||||
const [iv_hex, encrypted_base64_string] = combined.split(':');
|
||||
const base64 = encrypted_base64_string;
|
||||
const iv = new Uint8Array(iv_hex.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));
|
||||
const match_result = iv_hex.match(/.{1,2}/g);
|
||||
const iv = new Uint8Array((match_result || []).map((byte) => parseInt(byte, 16)));
|
||||
if (log_lvl) {
|
||||
console.log(`IV: ${iv}; Encrypted:`, base64);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user