mercredi 24 février 2016

Generate random human understandable ID for users in rails

I want to generate a unique (human recognisable) id for each user that changes when they comment on different posts in my app. (so doesn't need to be stored in db as is constantly changing). The ID only needs to be used within the scope of a thread.

What I mean by this is identical to what YikYak does. In YikYak, anonymity is essential, so in each thread, users are assigned a randomly generated avatar which is the only way they and other people recognise which posts are posted from the same user.

I'm building an app where I too need anonymity, but I need users to be able to recognise when other people are commenting more than once.

What is the best thing to generate? A string of 2 random words like "Brocolli umbrella"? Or is there a way to randomly generate a simple avatar?

Any advice much appreciated




Aucun commentaire:

Enregistrer un commentaire