Closed clementh59 closed 2 years ago
Dear @clementh59 ,
Good catch! You are correct. All timestamps should be converted to zero UTC.
I hope you do not need a fix urgently? ;-)
Kind regards and thanks again; Ralph
Dear @RalphTro ,
I see, thanks!
No, that's ok, I just want to be sure I understand the algorithm correctly :)
Regards,
Clément
Ah, I see, in e.g. https://github.com/RalphTro/epcis-event-hash-generator/blob/master/tests/examples/epcisDocWithSensorDataObjectEvent.jsonld we are missing to convert the time stamp value of sensorMetadata
->time
to canonical (Z) form.
@RalphTro Talking about the canonical time stamp form: how about using a simpler to serialise/de serialise form such as the numeric unix time stamp?
@clementh59 many thanks for spotting this bug!
Ah, I see, in e.g. https://github.com/RalphTro/epcis-event-hash-generator/blob/master/tests/examples/epcisDocWithSensorDataObjectEvent.jsonld we are missing to convert the time stamp value of
sensorMetadata
->time
to canonical (Z) form. @RalphTro Talking about the canonical time stamp form: how about using a simpler to serialise/de serialise form such as the numeric unix time stamp?
Hi @Echsecutor - THANKS A LOT for addressing this bug! Turning to your comment: from a mere technical POV, I think your suggestion makes sense; I see two issues with considering a change though: first, we are already in Public Community Review :-); second, it IMHO would be quite helpful if e.g. you have two implementations which return a different hash value and you want to compare the two underlying pre-hash strings. In such a situation, I think it's easier if one only needs to compare plain text values (in this case, the actual time stamps).
Hi,
In rule 8 of the algorithm, you say:
which means that timestamps can have a time offset, right?
This is indeed the case of the
time
field of asensorMetadata
. If you look at the exampleepcisDocWithSensorDataObjectEvent.jsonld
, the pre-hash string is:(It keeps the offset so everything is working as expected)
However, when you look at the pre-hash string of the last event in
SensorDataExamples.xml
, we have this field:But in the pre-hash string, it converts the date like this:
Is it the expected output? If it is the case, do I miss something in the algorithm?
Thanks a lot.