Random


PURPOSE   OPERATION   OPTIONS   COMMAND LINES   RELATED PROGRAMS


Author: Dan Mares, dmares @ maresware . com (you will be asked for e-mail address confirmation)
Portions Copyright © 1998-2021 by Dan Mares and Mares and Company, LLC
Phone: 678-427-3275

One liner: Creates lists of random numbers for whatever purpose.


top

Purpose

Random is a command line program designed to generate random numbers. Its command line allows for different options which include a seed, max numbers generated and highest number generated.

Get random.exe


top

Operation

The command line allows you to generate random numbers. You can then save these to a file for other uses such as selecting random records from a data base, or use these numbers as part of passwords.

C:>random -? will show the help screen. It only has a few options.

Random will generate the random numbers following the options provided. Review the optins section below to determine what optins are best for you.

During the run, if you redirect the output to a text file, you will have your list of random numbers.


top

Options

-?    Get a help screen.

-[sS] + #: /* use # as seed. same # generates same results. default: seed of 2 is used */

-[cC] + #: /* produce this many (count) random numbers. default: 10 */

-[mM] + #: /* upper limit of numbers to generate */

-o + outputfilename: /* put random numbers in this output file. see disksort command below */

-z:    random numbers have leading zeros. 0012345

             However, in ALL outputs, the length of the line is 13 characters 
             "     00123456"    (-m 8 -z option)
             "       123456"    (-m 8 no option)


top

Command Lines

C:>random -? /* show the help screen */

C:>random -s + 25: /* use 25 as seed. same # generates same results. default: seed of 2 is used */

C:>random -c + 2000: /* produce this many (count) random numbers. default: 10 */

C:>random -m + 99999: /* upper limit of numbers to generate */

This command delivered the following results (13 characters wide): random -c 10 -m 99999

    67108
     1610
    53687
     1073
     2151
    30316
    67374
    12560
    11966
     3355

To eliminate duplicates from the output, use the maresware disksort program with the following command line.
c:>    disksort   outputfilename   outputfilename.unq   -r 15   -p   0    -l   13   -u

Adding the -z to the random run, and the disksort results in 
     01073
     01610
     02151
     03355
     11966
     12560
     30316
     53687
     67108
     67374

and then running thru hash_lines get a reliable start to a password generator
     01073|13|60D00DB80FA15356CDF2FD5011ED39FA|A6FE5F4065A3B37EA935F0C34609100D11CB5B4C
     01610|13|36635882DB1B9115C4EE2C42FE8575E1|A0A21B1974DC7C15E307B582F76C31B8814C568A
     02151|13|4FD36E77ABE7736F91CB43618E543E0A|50DDCC568EE0DF6C4AA2126919E24999DCAC420A
     03355|13|3AB13999DB4ABE312BA062F8657FC674|CFBEB3F7C5DF5AA907B402342C1951F65B3071E3
     11966|13|8AA1868D41A875293A18CCB0CB922E42|3D3BC732999806DF2F4C74D66331FA7E2134D713
     12560|13|BA69A726441237E01D27DE2A71742BE5|03C096EBB0644591D526965C4A705A3E09BD3547
     30316|13|9B165147BB1E9F23EED02B5E7D8EFBD7|B835669B05DBA561C4A4E363E87CFBE88554A264
     53687|13|B55B77EF17D5F2701F546F7DF7DFD5F6|886FEDFB070C3B4FD269BCE8DB44E529ED94ED9E
     67108|13|2E804C02CAABB46A10898A5E14816C51|33ADD6FCF414CE9141A63143BD8F0C8A47ED0989
     67374|13|67AA655030107DCB01017D30C2DC9B9B|A5B9E5E1ED1243B38C341A0E131A0A8B34EDAA9D

here is the batch file to accomplish this. generate max of 500 numbers (uniqued down to 461)
with a high value of 99999. Then add the MD5/SHA values to each line for more uniqueness.


c:>random     -m 99999   -c 500  -z  -o  randomnos.txt
c:>disksort   randomnos.txt randomnos.srt -r 15 -p 0 -l 13 -u
c:>hash_lines randomnos.srt > randoms

00065|13|02352C1C9D9E5EC6F52B4E4B309D4131|D9BDA160C505AD49F1EB4D2828D935036F493FDF 00166|13|227E583F13C5B37C59CA122ECF984C34|DDFB1C141E9D28B775CB36FFCE4AFB6BB4DE7E1C

top

Related Programs

None