Skip to main content

encrypt_sensor

Function encrypt_sensor 

Source
pub fn encrypt_sensor(
    events_json: &[u8],
    pf: &[u8],
    cu: &[u8],
) -> Result<Vec<u8>, AppError>
Expand description

Encrypt a fully serialised sensor event batch.

  • events_json — UTF-8 bytes of JSON.stringify(events) output (hY in the JS reference is JSON.stringify for our input shapes).
  • pfpf() page-fingerprint bytes (or the tenant fallback when the runtime would have used gC(365)).
  • cu — the ctx.cu salt (the vK field).