MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / encryptData

Method encryptData

wxapp/junpinhui.js:295–302  ·  view source on GitHub ↗
(data = {})

Source from the content-addressed store, hash-verified

293 }
294
295 async encryptData(data = {}) {
296 const payload = data && typeof data === "object" ? { ...data } : {};
297 const key = await this.getEncryptKey();
298 payload.ts = Date.now();
299 payload.encryptData = aesCbcPkcs7Hex(JSON.stringify(payload), key.encryptKey, key.iv);
300 payload.version = key.version;
301 return payload;
302 }
303
304 async encryptedPost(urlPath, data = {}) {
305 return this.gardenPost(urlPath, await this.encryptData(data));

Callers 2

encryptedPostMethod · 0.95
encryptedGetMethod · 0.95

Calls 2

getEncryptKeyMethod · 0.95
aesCbcPkcs7HexFunction · 0.85

Tested by

no test coverage detected