mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-11-01 22:31:06 +00:00
chore: update to version 14.0.11 and align website URLs
This commit is contained in:
1 parent
ef74383349
commit
19c8d69bd8
1499 files changed
+53633
-89
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { hexToU8a, isHex } from '@pezkuwi/util';
|
||||
import { base64Decode } from '../base64/index.js';
|
||||
import { jsonDecryptData } from './decryptData.js';
|
||||
export function jsonDecrypt({ encoded, encoding }, passphrase) {
|
||||
if (!encoded) {
|
||||
throw new Error('No encrypted data available to decode');
|
||||
}
|
||||
return jsonDecryptData(isHex(encoded)
|
||||
? hexToU8a(encoded)
|
||||
: base64Decode(encoded), passphrase, Array.isArray(encoding.type)
|
||||
? encoding.type
|
||||
: [encoding.type]);
|
||||
}
|
||||
Reference in new issue
Block a user