home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / mkpasswd.icn < prev    next >
Text File  |  2000-07-29  |  1KB  |  50 lines

  1. ############################################################################
  2. #
  3. #    File:     mkpasswd.icn
  4. #
  5. #    Subject:  Program to make passwords
  6. #
  7. #    Author:   Jere K{pyaho
  8. #
  9. #    Date:     August 14, 1996
  10. #
  11. ############################################################################
  12. #
  13. #   This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program creates a list of randomly generated passwords.
  18. #
  19. #  Passwords consist of eight random characters [A-Z][0-9].
  20. #
  21. #  Number of passwords to generate is given as the first argument; default 1.
  22. #
  23. ############################################################################
  24.  
  25. procedure main(Args)
  26.    local count, i
  27.  
  28.         count := integer(Args[1]) | 1
  29.         
  30.         every i := 1 to count do
  31.                 write( genpasswd() )
  32.  
  33. end
  34.  
  35. #
  36. # genpasswd: generate and return an 8-character password
  37. #
  38. procedure genpasswd()
  39.         
  40.         local i, s, ucalnum
  41.  
  42.         s := ""
  43.         ucalnum := &ucase ++ &digits
  44.         every i := 1 to 8 do
  45.                 s := s || ?ucalnum
  46.  
  47.         return s
  48.  
  49. end
  50.