[encode_koremutake]

Description

Link: [encode_koremutake]
Author: Johan Sölve
Category: Encoding
Version: 8.x
License: Public Domain
Posted: Feb. 12, 2008
Updated: Jul. 09, 2008
More by this author...
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."

Parameters

-input integer, required The number to encode, must be positive integer

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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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

none

Email:


Password:



Newest

Most Popular