Skip to content

Conversation

@jdevost
Copy link
Contributor

@jdevost jdevost commented Jan 20, 2022

The limit for permanentid in the index is actually 60 characters. hashlib.sha256() is generating a 64-character hash.

Rather than simply truncating it, I am proposing the default algorithm to generate permanentid in the index: md5[:30]+sha1[:30]


CDX-784

Copy link
Contributor

@louis-bompart louis-bompart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks a bunch for your contribution :D
May I ask what made you think of using a MD5 on the 30 first char + sha1 on the same ones

@jdevost
Copy link
Contributor Author

jdevost commented Jan 20, 2022

Looks good! Thanks a bunch for your contribution :D May I ask what made you think of using a MD5 on the 30 first char + sha1 on the same ones

Just to be clear, it's the first 30 characters of the md5 of the whole string, and the first 30 characters of the sha1 on the whole string.

I use that because that's what is used internally by our connectors.

@louis-bompart louis-bompart changed the title fix: permanentid - replace sha256 by md5(30)+sha1(30) feat: permanentid - replace sha256 by md5(30)+sha1(30) Jan 20, 2022
@louis-bompart louis-bompart merged commit d9484ee into main Jan 20, 2022
@y-lakhdar y-lakhdar deleted the generate-permanent-id branch June 15, 2023 18:21
This was referenced Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants