From Bulbapedia, the community-driven Pokémon encyclopedia.
The personality value is a doubleword that controls many constant characteristics of a certain Pokémon.
For every in-depth explanation, take p to represent the actual doubleword value. Furthermore, pw will denote the lowest word value of p where necessary.
Gender is determined by the least significant byte of the personality. Each Pokémon has its own value to check this byte agains in its Base Stats structure. If the value in the structure is 0xFF, the Pokémon is always genderless. Otherwise, if the lowest byte of p is less than or equal to the byte in the base stats, the Pokémon is considered female.
Nature is (p modulo 25).
The number acquired corresponds to the personality as follows:
|p mod 25
Shininess depends not solely on the personality, but the zero-value found to be (p xor [Trainer ID]). Take the higher and lower word of this value and xor them again to each other. If the resulting value is less than 8 then the Pokémon is shiny. That means that there's a 2/65025 chance of getting a shiny Pokémon.
Interpret each byte in p as (x,y) coordinates of each spot. The least significant 4 bits (lowest nibble) in each byte is the x-coordinate, the highest is the y-coordinate.
Unown's letter is taken from the modulus of the combination of the least significant 2 bits of each byte in p. That is, the letter (0-27) can be expressed as:
up = (((p and 0x00000003) or ((p and 0x00000300) shr 6) or ((p and 0x00030000) shr 12) or ((p and 0x03000000) shr 18)) modulo 28)
Wurmple's evolution isn't random. Take (pw modulo 10) in the following ternary expression:
((pw modulo 10) < 5) ? SILCOON : CASCOON
If it resolves to a value below 5, it's a Silcoon, otherwise it's a Cascoon.