mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 02:07:56 +00:00
15 lines
452 B
JavaScript
15 lines
452 B
JavaScript
import { base64Encode } from '../base64/index.js';
|
|
import { ENCODING, ENCODING_NONE, ENCODING_VERSION } from './constants.js';
|
|
export function jsonEncryptFormat(encoded, contentType, isEncrypted) {
|
|
return {
|
|
encoded: base64Encode(encoded),
|
|
encoding: {
|
|
content: contentType,
|
|
type: isEncrypted
|
|
? ENCODING
|
|
: ENCODING_NONE,
|
|
version: ENCODING_VERSION
|
|
}
|
|
};
|
|
}
|