libais icon indicating copy to clipboard operation
libais copied to clipboard

Add ID:s

Open redhog opened this issue 10 years ago • 2 comments

  • Hash of original lines
  • Hash of nmea line contents (without tagblock etc)
  • Random id for differentiating copies of the same line

redhog avatar Jun 25 '15 15:06 redhog

@redhog suggested https://docs.python.org/2/library/uuid.html for the random id.

schwehr avatar Jun 26 '15 17:06 schwehr

Possibly shortened by using a base64 rather than hex encoding:

import uuid, base64
msg_id = base64.b64encode(uuid.uuid4().bytes)

We can't just use the raw bytes, as e.g. the json container does not support that.

redhog avatar Jun 28 '15 08:06 redhog