mardi 8 décembre 2015

Random number generator that after an X process will always result the same number

I want to create a php program that generates random sequance of numbers ranged from 0 to F in hex (0..15 in decimal). After a specific processing for example adding them all in sequence will always results a specific number ie 100 (decimal). One more restriction is that the total length of those number will be static adjusted by the user for example 10.

For example.

32FFFFAAA5 = is valid because 3+2+F+F+F+F+A+A+A+5 = 100 and total length of numbers is 10

05AAAFFFF5 = is also valid because 0+5+A+A+A+F+F+F+F+5 = 100 and total length of numbers is 10




Aucun commentaire:

Enregistrer un commentaire