MCPcopy Create free account
hub / github.com/codetheweb/tuyapi / decrypt

Method decrypt

lib/cipher.js:120–130  ·  view source on GitHub ↗

* Decrypts data. * @param {String|Buffer} data to decrypt * @returns {Object|String} * returns object if data is JSON, else returns string

(data)

Source from the content-addressed store, hash-verified

118 * returns object if data is JSON, else returns string
119 */
120 decrypt(data) {
121 if (this.version === '3.4') {
122 return this._decrypt34(data);
123 }
124
125 if (this.version === '3.5') {
126 return this._decrypt35(data);
127 }
128
129 return this._decryptPre34(data);
130 }
131
132 /**
133 * Decrypts data for protocol 3.3 and before

Callers 2

getPayloadMethod · 0.80
cipher.jsFile · 0.80

Calls 3

_decrypt34Method · 0.95
_decrypt35Method · 0.95
_decryptPre34Method · 0.95

Tested by

no test coverage detected