there is no proved real random generator algorithm

来源: 2006-12-01 14:48:42 [旧帖] [给我悄悄话] 本文已被阅读:

Only sudo-random generator is available. 5000 non-repeating is not difficult.

If user is really not satisfied with general rand(), then use rand(timestamp) to generate a seed, and use CBC encryption to generate rest of numbers. Again the algorithm doesn't guarantee you anything, but you can use a silly search to find if there is any duplicated number. 5000 is not a big data.