@mega-yfue/eufy-sdk / decodeImageV1
Function: decodeImageV1()
ts
function decodeImageV1(data, p2pDid): Buffer<ArrayBufferLike> | null;Decode a v1 eufysecurity: blob to a plain JPEG buffer using the station's p2p_did. Returns null if the blob isn't v1. Mirrors the legacy decode: parse SERIAL + CODE, derive the key, AES-128-ECB-decrypt the first 256 bytes, splice the decrypted head back in front of the plaintext tail.
Parameters
data
Buffer
p2pDid
string
Returns
Buffer<ArrayBufferLike> | null