This is technically not correct. You will notice that if you generate a PID with pokegen for generation 3, there is a high likelihood for wild encounters that PKHex will flag it as invalid because the algorithm is much more complex than just PID/IV. You have to take into consideration the % chance of battle encounter, the wild encounter table entry, choosing a level, choosing a nature, abilities that change rates/syncs, and then the PID/IV. Additionally, it is highly likely that an event pokemon will be illegal too, even though PKHex flags it as correct. This has to do with the relationship between PID/IV and OTG which varies from event to event. The algorithms are NOT published directly and therefore generating/validating them will be difficult without lots of research.