HP3000-L Archives

May 1998, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jeff Vance <[log in to unmask]>
Reply To:
Jeff Vance <[log in to unmask]>
Date:
Tue, 5 May 1998 17:02:53 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (32 lines)
On May 5,  3:22pm, Paul H. Christidis wrote:
> I'd like a function that would return a random string of alternating
> constants and vowels (similar to MPEX).  I would use it to secure MPE users
> that were left without passwords.
>    altuser user.account;pass=![randomname()]

Maybe this will work?

PARM varname, minlen=4, maxlen=8
# This script returns in the variable specified as "varname" a `random'
# name consisting of letters and numbers (cannot start with a number)
# at least "minlen" characters long and not more than "maxlen" chars.
#
# expression for a `random' letter:
setvar letter "chr((hpcpumsecs mod 26)+ord('A'))"
# expression for a `random' number:
setvar number "chr((hpcpumsecs mod 10)+ord('0'))"
# first character must be a letter
setvar !varname !letter
# now fill in the rest, must have at least "minlen" chars , up to "maxlen"
setvar i 1
setvar limit min((hpcpumsecs mod !maxlen)+!minlen, !maxlen)
while setvar(i,i+1) <= limit do
   if odd(hpcpumsecs) then
      setvar !varname !varname + !letter
   else
      setvar !varname !varname + !number
   endif
endwhile

--

ATOM RSS1 RSS2