Problem: Without going into requirements I have clients applications on iPhone and Android which need to generate a number (4 digits ideally) which is then match to a number being generated on the server based on the same input e.g. a PIN and the generated number needs to be static for one day (from 6am onwards)
So iPhone client running the application will generate a number 3456 based on PIN 1245677 and server will generate the same number based on the same PIN at 5am
At 6am the generated numbers need to change
I appreciate this may seem like a strange problem but is something that needs to be build into my application based on requirements (mainly being the device needs to run without any network connection)
The server will be in Java with iPhone and Android clients
You’ll have to generate the number using a seed that’s deterministic. You could use the date a long with an arbitrary ID that was assigned to the client and then generate a hash to represent the number you need.