Class Index | File Index

Classes


Namespace Pot.Archive.AlphamericString


Defined in: <pot.js>.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Compress/Decompress the data using the LZ77 algorithm.
Method Summary
Method Attributes Method Name and Description
<static>  
Pot.Archive.AlphamericString.decode(a)
Decompress with decode a string from the AlphamericString (base 63 [a-zA-Z0-9_] format string).
<static>  
Pot.Archive.AlphamericString.encode(string)
Compress with encode a string to the base 63 [a-zA-Z0-9_] format string.
Namespace Detail
Pot.Archive.AlphamericString
Compress/Decompress the data using the LZ77 algorithm. cf. @link http://www.ietf.org/rfc/rfc1951.txt via AlphamericHTML
See:
http://nurucom-archives.hp.infoseek.co.jp/digital/
Method Detail
<static> {Function} Pot.Archive.AlphamericString.decode(a)
Decompress with decode a string from the AlphamericString (base 63 [a-zA-Z0-9_] format string).
  var string = 'Hello Hello foooooooo baaaaaaaar';
  var result = Pot.Archive.AlphamericString.encode(string);
  var decode = Pot.Archive.AlphamericString.decode(result);
  debug('string = ' + string + ' : length = ' + string.length);
  debug('result = ' + result + ' : length = ' + result.length);
  debug('decode = ' + decode + ' : length = ' + decode.length);
  // @results
  //   string = 'Hello Hello foooooooo baaaaaaaar' : length = 32
  //   result = 'Y8Z5CCF_v56F__5X0Z21__5I'         : length = 24
  //   decode = 'Hello Hello foooooooo baaaaaaaar' : length = 32
  // Example of compression that is include multibyte string.
  var string = 'Hello Hello こんにちは、こんにちは、にゃーにゃー';
  var result = Pot.Archive.AlphamericString.encode(string);
  var decode = Pot.Archive.AlphamericString.decode(result);
  // Note the change of byte size.
  var bytesS = utf8ByteOf(string);
  var bytesR = utf8ByteOf(result);
  var bytesD = utf8ByteOf(decode);
  debug('string=' + string + ', length=' + string.length +
        ', ' + bytesS + ' bytes');
  debug('result=' + result + ', length=' + result.length +
        ', ' + bytesR + ' bytes');
  debug('decode=' + decode + ', length=' + decode.length +
        ', ' + bytesD + ' bytes');
  // @results
  //   string = 'Hello Hello こんにちは、こんにちは、にゃーにゃー',
  //     length = 30,
  //     66 bytes
  //
  //   result = 'Y8Z5CCF_v5cJeJdB1Fa1_v4dBe3hS_y1',
  //     length = 32,
  //     32 bytes
  //
  //   decode = 'Hello Hello こんにちは、こんにちは、にゃーにゃー',
  //     length = 30,
  //     66 bytes
  //
Parameters:
{String} a
A input string.
Returns:
{String} A result string.

<static> {Function} Pot.Archive.AlphamericString.encode(string)
Compress with encode a string to the base 63 [a-zA-Z0-9_] format string.
  var string = 'Hello Hello foooooooo baaaaaaaar';
  var result = Pot.Archive.AlphamericString.encode(string);
  var decode = Pot.Archive.AlphamericString.decode(result);
  debug('string = ' + string + ' : length = ' + string.length);
  debug('result = ' + result + ' : length = ' + result.length);
  debug('decode = ' + decode + ' : length = ' + decode.length);
  // @results
  //   string = 'Hello Hello foooooooo baaaaaaaar' : length = 32
  //   result = 'Y8Z5CCF_v56F__5X0Z21__5I'         : length = 24
  //   decode = 'Hello Hello foooooooo baaaaaaaar' : length = 32
  // Example of compression that is include multibyte string.
  var string = 'Hello Hello こんにちは、こんにちは、にゃーにゃー';
  var result = Pot.Archive.AlphamericString.encode(string);
  var decode = Pot.Archive.AlphamericString.decode(result);
  // Note the change of byte size.
  var bytesS = utf8ByteOf(string);
  var bytesR = utf8ByteOf(result);
  var bytesD = utf8ByteOf(decode);
  debug('string=' + string + ', length=' + string.length +
        ', ' + bytesS + ' bytes');
  debug('result=' + result + ', length=' + result.length +
        ', ' + bytesR + ' bytes');
  debug('decode=' + decode + ', length=' + decode.length +
        ', ' + bytesD + ' bytes');
  // @results
  //   string = 'Hello Hello こんにちは、こんにちは、にゃーにゃー',
  //     length = 30,
  //     66 bytes
  //
  //   result = 'Y8Z5CCF_v5cJeJdB1Fa1_v4dBe3hS_y1',
  //     length = 32,
  //     32 bytes
  //
  //   decode = 'Hello Hello こんにちは、こんにちは、にゃーにゃー',
  //     length = 30,
  //     66 bytes
  //
Parameters:
{String} string
An input string.
Returns:
{String} A result string.

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Sep 21 2012 19:32:22 GMT+0900 (JST)