[c5_shortunique]

Description

Link: [c5_shortunique]
Author: Jason Huck
Category: Utility
Version: 7.x
License:
Posted: Jan. 16, 2006
Updated: Jan. 01, 0001
More by this author...
Generates a 14-character string based on the current datetime that should be unique in all but the most extreme cases. Useful in cases where you need to, for instance, create a unique, non-linear filename and [lasso_uniqueid] is just a few characters too long (with a dot-three extension) to guarantee safe file transfer via FTP.

Parameters

none


Sample Usage

[c5_shortunique]
						

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
13
14
15
16
17
18
19
20
21
22
23
24
25
26
define_tag: 'c5_shortunique';
	local: 'chars' = (map:
		0 = 'AaZz',
		1 = 'BbYy',
		2 = 'CcXx',
		3 = 'DdWw',
		4 = 'EeVv',
		5 = 'FfUu',
		6 = 'GgTt',
		7 = 'HhSs',
		8 = 'IiRr',
		9 = 'JjQq'
	);
	
	local: 'time' = (string: date->(format: '%Y%m%d%H%M%S'));
	
	local: 'out' = string;
	
	iterate: #time, local: 'thisDigit';
		local: 'rnd' = (math_random: -min=1, -max=5);
		#out = #chars->(find: (integer: #thisDigit))->(get: #rnd) + #out;
	/iterate;
	
	return: #out;
/define_tag;

 

Related Tags



Comments

none

Email:


Password:



Newest

Most Popular