
Up- and Download with FTP/SFTP/FTPS/HTTP/HTTPS. I hope you find this useful.Components Crossplatform Mac & Win Server Client Old Deprecated Guides Examples Videosġ0.3 10.4 10.5 11.0 11.1 11.2 11.3 11.4 11.5 11.6 Statistic FMM Blog Component: CURL Of course it helps eliminating the numbers, including the zero. The output of this function is superior in readability to most CAPTCHA images.

NStart = oRandom.InRange( 1, cVowels.Len() )Īnd here is what the output looks like when I ask for a readable random string of 20 characters:Įven when I’m including the characters of what I thought was ambiguous, the human mind is able to identify the pattern and accurately enter the string.

NStart = oRandom.InRange( 1, cConstanants.Len() )ĬCharacter = cConstanants.Mid( nStart, 1 ) So I converted the JavaScript function over to RealBasic:įunction RandomStringReadable(nStringLength AS Integer) As StringĭIM cConstanants AS String = “BCDFGHJKLMNPQRSTVWXYZ” I could use this as a light weight validation that the visitor wasn’t a bot of some type to my website. My original purpose was to create a shorter string that a user could reliably type in, and yet was random. This function generates strings that look like this: NStart = oRandom.InRange( 1, nNumberOfCharacters ) If IncludeSymbols = True then cSource = cSource + cRetVal, cCharacter As Stringĭim nNumberOfCharacters, nStart, nX As Integer If IncludeUpperCase = True then cSource = cSource + “ABCDEFGHIJKLMNOPQRSTUVWXYZ” If IncludeLowerCase = True then cSource = cSource + “abcdefghijklmnopqrstuvwxyz” If IncludeNumbers = True then cSource = cSource + “1234567890” But then I stumbled across a JavaScript code that created a human-readable string along the lines of what could be used by CAPTCHA functions.įirst, let us look at a string generation function that Pamoxi wrote on the forums:įunction RandomString(nStringLength As Integer, IncludeNumbers As Boolean, IncludeLowerCase As Boolean, IncludeUpperCase As Boolean, IncludeSymbols As Boolean) As String Easy enough to do with the way these functions are written by just removing them from the source character set. Originally, I was just going to create a random string generation function that avoids these characters. I’m sure that professional font creators think long and hard about how to design these characters, especially if their purpose is human identifiability. (eye, one, oh, and zero) Certain fonts have these characters virtually identical. I get really frustrated by the CAPTCHA strings when they include the ambiguous characters of I, 1, O, and 0. Originally I had need for a user ‘typable’ string. I just wanted to generate a reasonably random string.

Notice that this isn’t about generating a UUID. I’ve been thinking a lot of random strings lately.
