Skip to content

[Question] Magic bitwise operations #53

@nikoTM

Description

@nikoTM

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions