koremu.rb - Ruby implementation of the Koremutake Memorable Random Strings

SYNOPSIS

require 'koremu'

ks = KoremuString.new('KOREMUTAKE')
puts ks.to_ki              # 10610353957
puts ks.to_ka.join(',')    # 39,67,52,78,37

ki = KoremuFixnum.new(1248594)
puts ki.to_ks              # SUHITU
puts ki.to_ka .join(',')   # 76,26,82

ka = KoremuArray.new([50,15,20,13])
puts ka.to_ks              # MIFOGIFE
puts ka.to_ki              # 105105933

DESCRIPTION

For us humans, it’s always easier to remember a pronounceable string, even if it is meaningless, than to remember a long number. Koremutake is a system you can use to translate any number (of course, particularly suited at long numbers) to a sequence of syllables. Typical uses of Koremutake strings are auto-generated user passwords or URLs.

This module is based in Leon Brocard’s String::Koremutake Perl module, available at search.cpan.org/dist/String-Koremutake/lib/String/Koremutake.pm which is, in turn, based upon Shorl (shorl.com/koremutake.php). Koremutake is a «way to express any large number as a sequence of syllables», and the general idea is based in Sean B. Palmer’s «Memorable Random String» term, infomesh.net/2001/07/MeRS/

WHAT IS VALID KOREMUTAKE?

Koremutake consists of 128 valid syllables. They do not, of course, represent all of the valid syllables in any random human language - They are meanly meant to encode integers, not to transform text into strings. If you try to transform regular text, lots of information will be lost in the process

All of the syllables end with a vowel. The valid vowels are A, E, I, O, U and Y. The consonant particles are B, D, F, G, H, J, K, L, M, N, P, R, S, T, V, BR, DR, FR, GR, PR, ST and TR (TR has only TRA and TRE).

Koremutake is represented with uppercase letters (and that’s what it returns), but will recognize lowercase as well.

AUTHOR

This module was written by Gunnar Wolf <[email protected]>, Instituto de Investigaciones Económicas, UNAM.

Copyright © 2008 Gunnar Wolf <[email protected]>

LICENSING INFORMATION

This module is under a MIT license. For further information, please check the LICENSE file.

Getting the code

The module project’s home page can be found at rubyforge.org/projects/koremutake/

The project’s Git repository can be anonymously cloned from:

git clone git://rubyforge.org/koremutake.git