This response is mostly accurate. In generations after gen 2, the shininess is based off an XOR operation on the trainer ID (TID) and the secret ID (SID). You can see your TID without cheating, but the SID is only able to be seen by a cheating device. After these have the XOR operation applied, the two personality values also apply the XOR operation. Finally, the results of both operations have the XOR applied to both. For this reason, in every generation after gen 2, shiny Pokemon may have any spread of IVs. Also, in gen 2, the HP value isn't technically random. HP is determined by whether each DV in the other stats is even or odd. For attack, if it's odd it adds 8 to the HP DV, for odd defense it adds 4, for odd speed it adds 2, and for odd special it adds 1. For each of these stats, if they are even, it adds 0 to the HP DV. Since defense, speed, and special all need to be exactly 10, an even number, they will always add 0 to the HP DV. If attack is one of the odd values, HP DV will be 8. If attack is one of the even values listed above, the HP DV will be 0. For virtual console, the attack and defense requirements are reversed, meaning that the attack must be exactly 10 for the DV and defense must be 2, 3, 6, 7, 10, 11, 14, or 15. Due to this change, the HP DV for shiny Pokemon when transferring from VC to 6th or 7th gen will be either 0 or 4. Sorry if that was overly complicated, but I wanted to update this since it's different for VC which was put in place after the answer was initially given.