Squashman wrote: ↑05 Jul 2018 20:59Hmm, I have let it run for a couple of minutes at a time and output thousands of results and have not gotten a duplicate when adding.
Just reran a test using addition with the seed coming from the thousandths seconds from WMIC. Ran for 6 minutes and got 4148 unique GUID strings. No duplicates.
Code: Select all
@echo off
setlocal EnableDelayedExpansion
set "RandomSeq=21213,21941,17920,10457,19086,5729,12553,29660,2929,6968,17472,27711,18025,20260,1593,26714,31301,28749,19661,30131,4415,18317,26301,27669,30665,29733,2199,14050,4234,8110,222,18601"
echo RandomSeq=%RandomSeq%
for %%s in (1363,1923) do (
echo,
<nul set /p "=seed=%%s result: "
for %%n in (%RandomSeq%) do (
set /a "hex=(%%n + %%s) %% 16"
<nul set /p "=!hex!,"
)
)
echo,
One random sequence two different seeds same result.RandomSeq=21213,21941,17920,10457,19086,5729,12553,29660,2929,6968,17472,27711,18025,20260,1593,26714,31301,28749,19661,30131,4415,18317,26301,27669,30665,29733,2199,14050,4234,8110,222,18601
seed=1363 result: 0,8,3,12,1,4,12,15,4,11,3,2,12,7,12,13,8,0,0,6,2,0,0,8,12,8,10,5,13,1,1,12,
seed=1923 result: 0,8,3,12,1,4,12,15,4,11,3,2,12,7,12,13,8,0,0,6,2,0,0,8,12,8,10,5,13,1,1,12,
It is strange for me how you didn't observe the duplicates as running the two consecutive new cmd instances will most certainty produce the same random sequence it just needs the matching seeds.