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.

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top