[DAMD-4] Hash need to be 8byte Created: 16/Jun/16  Updated: 07/May/19  Resolved: 15/Jan/18

Status: Done
Project: Data Model
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: shimono Assignee: rhl
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to DAMD-56 Change pfsVisitHash formatting from %... Done

 Description   

Hash of calculate_pfsVisitHash and calculate_pfsConfigId need to be 8byte.
> # convert to int and truncate to 8 bytes
> sha1 = int(m.hexdigest(), 16) & 0xffffffff

I think 0xffffffff is 4byte....?



 Comments   
Comment by rhl [ 04/Sep/16 ]

Sorry this took so long to resolve (I thought I had real work to do!)

Yes, you're right, but the data model specifies 8 hex digits, so it's a typo in the comment. I've fixed it.

Comment by rhl [ 20/Nov/16 ]

I didn't merge the DAMD-4 code in utils.py, and when I came to finally merge the issue I realised that we do indeed have a problem. Shimono-san correctly fixed the SHA truncation, but he didn't address the filenames.

I specified 64-bit SHA1s; I think that that's plenty and anyway that's the biggest number that we can easily put into fits tables so let's stick to that. Unfortunately, I confused bytes with hexadecimal digits and specified %08x formats, whereas I should have said %016x.

This is a pain. I'd simply truncate the SHA1s to 4 bytes for filenames, except that some of the filenames include objIds, and they are also 64 bits and we can't simply truncate them as they are very far from random.

I think we have to face reality and write out all 16 hex digits in both places – ugly. What do you think?

Comment by rhl [ 15/Jan/18 ]

OK, I went with the 0x016x format and that is what is implemented in the data model and DRP-2D

Generated at Sat Feb 10 15:33:14 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.