Lasso Soft Inc. > Home

[encode_koremutake]

Linkencode_koremutake
AuthorJohan Solve
CategoryEncoding
Version8.x
LicensePublic Domain
Posted12 Feb 2008
Updated09 Jul 2008
More by this author...

Description

This tag encodes a positive integer into a Koremutake-encoded memorable string.

The term "Memorable Random String" was thought up by Sean B. Palmer as a name for those strings like dopynl, glargen, glonknic, spoopwiddle, and kebble etc. that dont have any conventional sense, but can be used as random identifiers, especially in URIs to keep them persistent. See http://infomesh.net/2001/07/MeRS/

Koremutake is a MeRS algorithm which is used by Shorl (http://shorl.com/koremutake). As they explain: "It is, in plain language, a way to express any large number as a sequence of syllables. The general idea is that word-sounding pieces of information are a lot easier to remember than a sequence of digits."

Sample Usage

encode_koremutake: 145513306;

Result: ROMENABRA

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: 'encode_koremutake', -description='Encodes an integer into a Memorable Random String according to the Koremutake algorithm, see http://infomesh.net/2001/07/MeRS and http://shorl.com/koremutake',
	-required='input', -type='integer', -copy;

	// http://shorl.com/koremutake
	fail_if: #input < 0, -9956, 'The tag ' + tag_name + ' requires a positive integer as input';
	local: 'phonemes'='BA BE BI BO BU BY DA DE DI DO DU DY FA FE FI FO FU FY GA GE GI GO GU GY HA HE HI HO HU HY JA JE JI JO JU JY KA KE KI KO KU KY LA LE LI LO LU LY MA ME MI MO MU MY NA NE NI NO NU NY PA PE PI PO PU PY RA RE RI RO RU RY SA SE SI SO SU SY TA TE TI TO TU TY VA VE VI VO VU VY BRA BRE BRI BRO BRU BRY DRA DRE DRI DRO DRU DRY FRA FRE FRI FRO FRU FRY GRA GRE GRI GRO GRU GRY PRA PRE PRI PRO PRU PRY STA STE STI STO STU STY TRA TRE' 
		-> split(' ');
	
	local: 'base' = #phonemes -> size - 1,
		'output'=string;
	while: #input>0;
		#output = #phonemes -> (get: (#input % (#base + 1))+1) + #output;
		#input = #input / (#base + 1);
	/while;
	
	return: #output;
/define_tag;

Related Tags

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