0

Example, the server has these ids:
aaaa, aaaa - 1 , aaaa - 2 , bbbb

If the client sign in, the server check client's algorithm
If the client's id is aaaa, server make client's id aaaa - 3
If the client's id is bbbb, server make client's id bbbb -1

How can i do that?

airhuff
  • 413
  • 6
  • 18

1 Answers1

0
  • Make a hash table that stores the number of times an id has been seen.
  • Check the hash table to see if an id has been seen:
    • If so, increment and return the number
    • If not, make a new entry and set to 0.
Richard
  • 56,349
  • 34
  • 180
  • 251