lundi 26 juin 2017

Any algorithm that use a number as a feed for generating random string?

I want to generate a random string with any fixed length (N) of my choice. With the same number as a feed to this algorithm it should generate the same string. (But more than one number might results in the same string) Any approaches for doing this?

(By the way, I have a set of characters that I want to appear in the string, like A-Z a-z 0-9)

I could random each characters one by one, but it would need N different seed for each characters. If I want to do it this way, the question might become "how to generate N numbers from one number" for the seeds.

The end goal is that I want to convert a GUID to something more readable on printed media and shorter. I don't care about conflict. (If the conflict did happen, I can still check the GUID for resolution)




Aucun commentaire:

Enregistrer un commentaire