Lasso Soft Inc. > Home

[xs_genPwd]

Linkxs_genPwd
AuthorJonathan Guthrie
CategoryCustom Tag
Version8.x
Licensehttp://creativecommons.org/licenses/by/2.5/
Posted18 Sep 2012
Updated18 Sep 2012
More by this author...

Description

Generates a random password of a given size.

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.

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','W','X','Y','Z','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

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft