There's a code for that:
Code:
[Change Trainer ID]
04100000 42935EE8 [Full ID]
04100000 429EC574 [Trainer ID]
04000000 027F1564 [Trainer ID]
Replace [Full ID] with the number you get by putting together your secret ID and your (6 digits) trainer ID, converting it to hex, and padding it to 8 digits, and [Trainer ID] with just the trainer ID converted to hex and padded to 8 digits.
So, for example, if you wanted a trainer ID of 098765, and the secret ID of 1234, the [Full ID] would be 498EDA4D (1234098765 converted to hex), and the [Trainer ID] would be 000181CD (098765 converted to hex).
If you end up with a full ID that is larger than 8 digits in hex, it means your secret ID is too big.