Pregunta

So I know about Identicons, MonsterID's, and Wavatars, etc, and understand that they use hashed IP addresses/e-mails to generate a unique avatar.

Is there any information about the algorithm so that I can create my own set? I'd like to do this in PHP.

¿Fue útil?

Solución

If 'ABCDEFGH' is the 32 bit hash of email id in hex format, you can use 'A' to pick the monster, 'B' to pick the eye color and so on.

Note that each letter here can have 16 different values. So you can choose 16 different values for each attribute. If you have more values use a longer selection of bits.

See http://us3.php.net/hash for more information about calculating hashes in php.

Otros consejos

You could also seed the random number generator with the hash, and then get various ranges. That way you wouldn't be limited by having to have exactly 16 different options for each element in the hash.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top