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

[Question] Magic bitwise operations #53

Open
nikoTM opened this issue Feb 25, 2023 · 0 comments
Open

[Question] Magic bitwise operations #53

nikoTM opened this issue Feb 25, 2023 · 0 comments

Comments

@nikoTM
Copy link

nikoTM commented Feb 25, 2023

Hi! Any chance you could elaborate on this code:

private static int CalculateTarget(EorzeaDateTime time) {

I stumbled upon this fascinating piece yesterday, still trying to understand what exactly is being done there:

var calcBase = (totalDays * 0x64) + increment;

var step1 = (calcBase << 0xB) ^ calcBase;
var step2 = (step1 >> 8) ^ step1;

return (int)(step2 % 0x64);

Thanks

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

No branches or pull requests

1 participant