Packet hash is useful for deduplication. You can group packet repeats using hash.
Example implementation:
const { MeshCoreDecoder } = require('@michaelhart/meshcore-decoder');
const { SHA256, enc } = require('crypto-js');
const raw = "...";
const packet = MeshCoreDecoder.decode(raw);
const payloadTypeHex = packet.payloadType.toString(16).padStart(2, '0');
const finalHex = payloadTypeHex + packet.payload.raw;
const hash = SHA256(enc.Hex.parse(finalHex)).toString(enc.Hex).slice(0, 16);
return hash;
Packet hash is useful for deduplication. You can group packet repeats using hash.
Example implementation: