[xs_genPwd]

Description

Link: [xs_genPwd]
Author: Jonathan Guthrie
Category: Custom Tag
Version: 8.x
License:
Posted: Mar. 08, 2006
Updated: Jan. 01, 0001
More by this author...
Generates a random password of a given size.

Parameters

-size integer, optional size of returned password

Sample Usage

local('newPassword' = xs_genPwd(-size=20));
						

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
1
2
3
4
5
6
7
8
9
10
11
12
define_tag('genPwd',
	-Optional='size', -Type='integer',-namespace='xs_');

	(!(local('size')))? local('size' = 8);

	local('pMap' = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','X','Y','Z','a','1','2','3','4','5','6','7','8','9','0'));
	local('thisPwd' = '');
	loop(#size);
		#thisPwd += #pMap->get(Math_Random(-min=1,-max=(#pMap->size)));
	/loop;
	return(@#thisPwd);
/define_tag;

 

Comments

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net