stjulian wrote:
...is there a way to create a random string of digits
in the length I request? Perhaps a string of 20 digits
with a few asterisks thrown in for ease of typing?
What do you mean by "digits"? Will ANY character on the keyboard do? Do you
have a bias toward numbers? Letters? Does case matter?
Your example had nothing but numbers and a dash, but you suggested that
asterisk and the letters ABCDEF would be fine (since you used GUIDs).
Here's an example that will generate an arbitrary-length string of
"typeable" characters:
function GenerateString(chars) {
for (var i=0,s=""; i<chars; i++)
s += String.fromCharCode(Math.floor(94*Math.random()+33 ))
return s
}
<%=GenerateString(20)%>
VBScript left as an exercise for the reader.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.