SaintCoinach
SaintCoinach copied to clipboard
[Question] Magic bitwise operations
Hi! Any chance you could elaborate on this code: https://github.com/Rogueadyn/SaintCoinach/blob/f969b441584688c02dde2fadac548c4a5aaa3faa/SaintCoinach/Xiv/WeatherRate.cs#L93
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