VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Generate a random string, with a length within a range.

Gregg Housh  (10 Submissions)   String Manipulation   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

This code will take a range (lower and upper), and output a string of random characters (0-9, A-Z, a-z). I use this to generate a key for encryption, during the key negotiation phase of a connection to an encrypted server.
Usage is simple:
Dim sKey as string
sKey = GenerateKey(10,100)
' this code generates a key with a length between
' 10 and 100 characters.

Inputs
iLower: Lowest possible length for the string iUpper: Maximum length for the string

Returns
Returns a string.

Rate Generate a random string, with a length within a range. (5(5 Vote))
Generate a random string, with a length within a range..bas

Generate a random string, with a length within a range. Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters