Open DigitalArchmage opened 9 years ago
I was checking my output again, to see if it varied. It did not.
Upon reflection, my guess for why they do this is so that the ID looks a bit more randomized than it is - so everyone's numbers aren't clearly neighbors of each other. It's obvious when I look at my friends list in the JSON data that the older IDs are tending to start with 325 and the newer ones 335 (My spread looks to be ~10.5 million IDs).
So they're incrementing by 1 in their database in the sane/normal way, but they didn't like showing that right in the ID, so they shuffled the numbers for the game's output. Pretty smart.
Months ago, I had thought it odd that the A, B, C, D, E "group" was determined by the 3rd digit of our ID. Well, it turns out that it's the last digit of the actual ID (which means they get uniform distribution between groups and it makes sense again).
Now that I realize why they're scrambling (not to trip up sniffers), I'm less concerned with the idea it could change. Plus the realization about digit 3 makes me think they're not going to be scrambling it differently for different people (if the 3rd digit always maps to the last digit and the 1st always maps to the 1st).
I noticed that "importing friends from JSON data" is yet to be implemented, so I looked at the JSON data. I saw that the friend IDs were scrambled.
I've only tested my exports, but they appear to be scrambled the same way each time.
There's a preceding number "4" on each of them, and I'm wondering if that's not a clue as to how they're scrambled (mine sort of appear to keep skipping 3 and taking the 4th digit if I get really fudgy with how I wrap back around it). This is making me wonder if there's not a more clever function than this brute force function (included below), that would take into account any "key" that it may be sending alongside the scrambled numbers.
I realize I'm possibly not working with the entire puzzle (but you should be able to see more of the puzzle than I can, if you're saving user uploaded JSON import data for a while)
In PHP because that's how I think:
function reorderDigits($digits) {
}