Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wordpress galleries: use hash value that stays identical over different invocations #450

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

felixfontein
Copy link
Contributor

I noticed that the gallery ID uses Context.id, which was initialized with hash() from some string. Since the value of hash() can change between different invocations of Python, this is not very helpful... I've replaced it with a truncated SHA256 converted to int. It's a bit inefficient, but definitely stable.

I've only used this for one old travel blog that hasn't been updated since 2014, so I never noticed that the gallery IDs change...

(There's another hash() use in the LaTeX parser, but that ID is never used as far as I can see, so I didn't touch it for now.)

@Kwpolska Kwpolska enabled auto-merge (squash) November 2, 2024 21:19
@Kwpolska Kwpolska merged commit 4b73595 into master Nov 2, 2024
7 checks passed
@Kwpolska Kwpolska deleted the hash branch November 2, 2024 21:20
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.

2 participants