How can I generate random alphanumeric strings?

后端 未结 30 2769
予麋鹿
予麋鹿 2020-11-22 03:17

How can I generate a random 8 character alphanumeric string in C#?

30条回答
  •  甜味超标
    2020-11-22 03:58

    If your values are not completely random, but in fact may depend on something - you may compute an md5 or sha1 hash of that 'somwthing' and then truncate it to whatever length you want.

    Also you may generate and truncate a guid.

提交回复
热议问题