title Bubble Babble Encoding user strick ip 216.218.244.9 vol 1 lock ******** Strick designed something similar once, with the same alternation of ConsonantVowelConsonantVowelConsonant, but this one by Antti Huima is far better, with checksums and nice (subliminal) begin & end markers. /list( -def * Here's the spec: /box( /file Bubble_Babble_Encoding.txt /box) * Here's test vectors: /pre( ASCII Input Encoding ------------------------------------------------------------------ `' (empty string) `xexax' `1234567890' `xesef-disof-gytuf-katof-movif-baxux' `Pineapple' `xigak-nyryk-humil-bosek-sonax' /pre) Notice the encoding always begins & ends with "x", so the elements of the encoding of `Pineapple' are not /b xigak nyryk humil bosek & /b sonax but rather /b igak-n yryk-h umil-b osek-s & a final partial record /b ona . * Here's the meat of it: /pre( Below, _|X|_ denotes the largest integer not greater than X. Let the data to be encoded be D[1] ... D[K] where K is the length of the data in bytes; every D[i] is an integer from 0 to 2^8 - 1. First define the checksum series C[1] ... C[_|K/2|_] where C[1] = 1 C[n] = (C[n - 1] * 5 + (D[n * 2 - 3] * 7 + D[n * 2 - 2])) mod 36 The data is then transformed into _|K/2|_ `tuples' T[1] ... T[_|K/2|_] and one `partial tuple' P so that T[i] = where a = (((D[i * 2 - 3] >> 6) & 3) + C[i]) mod 6 b = (D[i * 2 - 3] >> 2) & 15 c = (((D[i * 2 - 3]) & 3) + _|C[i] / 6|_) mod 6 d = (D[i * 2 - 2] >> 4) & 15; and e = (D[i * 2 - 3]) & 15. The partial tuple P is P = where if K is even then a = (C[i]) mod 6 b = 16 c = _|C[i] / 6|_ but if it is odd then a = (((D[K] >> 6) & 3) + C[i]) mod 6 b = (D[K] >> 2) & 15 c = (((D[K]) & 3) + _|C[i] / 6|_) mod 6 The `vowel table' V maps integers between 0 and 5 to vowels as 0 - a 1 - e 2 - i 3 - o 4 - u 5 - y and the `consonant table' C maps integers between 0 and 16 to consonants as 0 - b 1 - c 2 - d 3 - f 4 - g 5 - h 6 - k 7 - l 8 - m 9 - n 10 - p 11 - r 12 - s 13 - t 14 - v 15 - z 16 - x The encoding E(T) of a tuple T = is then the string V[a] C[b] V[c] C[d] `-' C[e] where there are five characters, and `-' is the literal hyphen. The encoding E(P) of a partial tuple P = is the three-character string V[a] C[b] V[c]. Finally, the encoding of the whole input data D is obtained as `x' E(T[1]) E(T[2]) ... E(T[_|K/2|_]) E(P) `x' where `x's are literal characters