mol_charset_ucf_lib 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mol_charset_ucf_lib",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "exports": {
5
5
  "node": {
6
6
  "import": "./node.mjs",
package/web.d.ts CHANGED
@@ -20,6 +20,7 @@ declare namespace $ {
20
20
 
21
21
  declare namespace $ {
22
22
  function $mol_charset_ucf_encode(str: string): Uint8Array<ArrayBuffer>;
23
+ function $mol_charset_ucf_encode_to(str: string, buf: Uint8Array<ArrayBuffer>, from?: number): number;
23
24
  }
24
25
 
25
26
  declare namespace $ {
package/web.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../mam.d.ts","../../../buffer/buffer.d.ts","../../encode/encode.d.ts","../../decode/decode.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACfA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA","sourcesContent":[null,null,null,null]}
1
+ {"version":3,"sources":["../../../../../mam.d.ts","../../../buffer/buffer.d.ts","../../encode/encode.d.ts","../../decode/decode.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACfA;AACA;AACA;AACA;ACHA;AACA;AACA;AACA;AACA;ACJA;AACA;AACA;AACA","sourcesContent":[null,null,null,null]}
package/web.deps.json CHANGED
@@ -1 +1 @@
1
- {"files":["mam.ts","LICENSE","README.md","mam.jam.js","tsfmt.json","package.json","tsconfig.json","lang.lang.tree","meta.lang.tree","sandbox.config.json","mol/CNAME","mol/LICENSE","mol/readme.md","mol/mol.meta.tree","mol/CONTRIBUTING.md","mol/CODE_OF_CONDUCT.md","mol/charset/ucf/readme.md","mol/charset/buffer/buffer.ts","mol/charset/ucf/encode/encode.ts","mol/charset/ucf/decode/decode.ts","mol/charset/ucf/lib/lib.meta.tree"],"mods":{},"deps_in":{"mol/charset/ucf":{"mol/charset/ucf/lib":-999,"mol/charset/ucf/encode":-999,"mol/charset/ucf/decode":-999},"mol/charset":{"mol/charset/ucf":-999,"mol/charset/buffer":-999},"mol":{"mol/charset":-999},"":{"mol":-999},"mol/charset/ucf/encode":{"mol/charset/ucf/lib":-999},"mol/charset/buffer":{"mol/charset/ucf/encode":-2},"mol/charset/ucf/decode":{"mol/charset/ucf/lib":-999}},"deps_out":{"mol/charset/ucf/lib":{"mol/charset/ucf":-999,"mol/charset/ucf/encode":-999,"mol/charset/ucf/decode":-999},"mol/charset/ucf":{"mol/charset":-999},"mol/charset":{"mol":-999},"mol":{"":-999},"mol/charset/ucf/encode":{"mol/charset/ucf":-999,"mol/charset/buffer":-2},"mol/charset/buffer":{"mol/charset":-999},"mol/charset/ucf/decode":{"mol/charset/ucf":-999}},"sloc":{"ts":97,"LICENSE":113,"md":486,"js":9,"json":82,"tree":43,"CNAME":1},"deps":{"mol/charset/ucf/lib":{"..":-999,"/mol/charset/ucf/encode":-999,"/mol/charset/ucf/decode":-999},"mol/charset/ucf":{"..":-999},"mol/charset":{"..":-999},"mol":{"..":-999},"":{},"mol/charset/ucf/encode":{"..":-999,"/mol/charset/ucf/encode":-1,"/mol/charset/buffer":-2,"/mol/charset/ucf/encode/to":-1},"mol/charset/buffer":{"..":-999,"/mol/charset/buffer":-1},"mol/charset/ucf/decode":{"..":-999,"/mol/charset/ucf/decode":-1}}}
1
+ {"files":["mam.ts","LICENSE","README.md","mam.jam.js","tsfmt.json","package.json","tsconfig.json","lang.lang.tree","meta.lang.tree","sandbox.config.json","mol/CNAME","mol/LICENSE","mol/readme.md","mol/mol.meta.tree","mol/CONTRIBUTING.md","mol/CODE_OF_CONDUCT.md","mol/charset/ucf/readme.md","mol/charset/buffer/buffer.ts","mol/charset/ucf/encode/encode.ts","mol/charset/ucf/decode/decode.ts","mol/charset/ucf/lib/lib.meta.tree"],"mods":{},"deps_in":{"mol/charset/ucf":{"mol/charset/ucf/lib":-999,"mol/charset/ucf/encode":-999,"mol/charset/ucf/decode":-999},"mol/charset":{"mol/charset/ucf":-999,"mol/charset/buffer":-999},"mol":{"mol/charset":-999},"":{"mol":-999},"mol/charset/ucf/encode":{"mol/charset/ucf/lib":-999},"mol/charset/buffer":{"mol/charset/ucf/encode":-2},"mol/charset/ucf/decode":{"mol/charset/ucf/lib":-999}},"deps_out":{"mol/charset/ucf/lib":{"mol/charset/ucf":-999,"mol/charset/ucf/encode":-999,"mol/charset/ucf/decode":-999},"mol/charset/ucf":{"mol/charset":-999},"mol/charset":{"mol":-999},"mol":{"":-999},"mol/charset/ucf/encode":{"mol/charset/ucf":-999,"mol/charset/buffer":-2},"mol/charset/buffer":{"mol/charset":-999},"mol/charset/ucf/decode":{"mol/charset/ucf":-999}},"sloc":{"ts":92,"LICENSE":113,"md":489,"js":9,"json":82,"tree":43,"CNAME":1},"deps":{"mol/charset/ucf/lib":{"..":-999,"/mol/charset/ucf/encode":-999,"/mol/charset/ucf/decode":-999},"mol/charset/ucf":{"..":-999},"mol/charset":{"..":-999},"mol":{"..":-999},"":{},"mol/charset/ucf/encode":{"..":-999,"/mol/charset/ucf/encode":-1,"/mol/charset/buffer":-2,"/mol/charset/ucf/encode/to":-1},"mol/charset/buffer":{"..":-999,"/mol/charset/buffer":-1},"mol/charset/ucf/decode":{"..":-999,"/mol/charset/ucf/decode":-1}}}
package/web.js CHANGED
@@ -45,96 +45,91 @@ var $;
45
45
  "use strict";
46
46
  var $;
47
47
  (function ($) {
48
- let buf = new Uint8Array(2 ** 12);
49
48
  function $mol_charset_ucf_encode(str) {
50
49
  const buf = $mol_charset_buffer(str.length * 3);
51
50
  return buf.slice(0, $mol_charset_ucf_encode_to(str, buf));
52
51
  }
53
52
  $.$mol_charset_ucf_encode = $mol_charset_ucf_encode;
53
+ const fast_char = `0123456789.,:;()?!-'" \n`;
54
+ const fast_map = new Array(0x80).fill(0);
55
+ for (let i = 0; i < fast_char.length; ++i)
56
+ fast_map[fast_char[i].charCodeAt(0)] = i | 0x80;
54
57
  function $mol_charset_ucf_encode_to(str, buf, from = 0) {
55
58
  let pos = from;
56
- let mode = 0xF;
59
+ let mode = 0x9C;
57
60
  for (let i = 0; i < str.length; i++) {
58
61
  let code = str.charCodeAt(i);
59
62
  if (code >= 0xd800 && code < 0xe000)
60
63
  code = ((code - 0xd800) << 10) + str.charCodeAt(++i) + 0x2400;
61
- if (code < 0x20) {
62
- if (code > 0x08 && code < 0x0E) {
63
- buf[pos++] = code;
64
- }
65
- else {
66
- if (mode !== 0x0E)
67
- buf[pos++] = mode = 0x0E;
68
- buf[pos++] = code | 0x80;
64
+ if (code < 0x80) {
65
+ if (mode !== 0x9C) {
66
+ const fast = fast_map[code];
67
+ if (fast)
68
+ code = fast;
69
+ else
70
+ buf[pos++] = mode = 0x9C;
69
71
  }
72
+ buf[pos++] = code;
73
+ }
74
+ else if (code < 0x32_00) {
75
+ const page = (code >> 7) + 0x9C;
76
+ if (mode !== page)
77
+ buf[pos++] = mode = page;
78
+ buf[pos++] = code & 0x7F;
79
+ }
80
+ else if (code < 0x04_20_00) {
81
+ code -= 0x2000;
82
+ const page = (code >> 15) + 0x98;
83
+ if (mode !== page)
84
+ buf[pos++] = mode = page;
85
+ buf[pos++] = code & 0x7F;
86
+ buf[pos++] = code >> 7;
70
87
  }
71
88
  else {
72
- if (code < 0xFF) {
73
- buf[pos++] = code;
74
- }
75
- else if (code < 0x09_00) {
76
- const page = (code >> 7) + 0x0E;
77
- if (mode !== page)
78
- buf[pos++] = mode = page;
79
- buf[pos++] = (code & 0x7F) | 0x80;
80
- }
81
- else if (code < 0x04_00_00) {
82
- const page = code >> 15;
83
- if (mode !== page)
84
- buf[pos++] = mode = page;
85
- buf[pos++] = (code & 0x7F) | 0x80;
86
- buf[pos++] = code >> 7;
87
- }
88
- else {
89
- if (mode !== 0x08)
90
- buf[pos++] = mode = 0x08;
91
- buf[pos++] = (code & 0x7F) | 0x80;
92
- buf[pos++] = code >> 7;
93
- buf[pos++] = code >> 15;
94
- }
89
+ if (mode !== 0x97)
90
+ buf[pos++] = mode = 0x97;
91
+ buf[pos++] = code & 0x7F;
92
+ buf[pos++] = code >> 7;
93
+ buf[pos++] = code >> 15;
95
94
  }
96
95
  }
97
96
  return pos - from;
98
97
  }
98
+ $.$mol_charset_ucf_encode_to = $mol_charset_ucf_encode_to;
99
99
  })($ || ($ = {}));
100
100
 
101
101
  ;
102
102
  "use strict";
103
103
  var $;
104
104
  (function ($) {
105
- function $mol_charset_ucf_decode(buffer, mode = 0x0F) {
105
+ const fast_char = `0123456789.,:;()?!-'" \n`;
106
+ function $mol_charset_ucf_decode(buffer, mode = 0x9C) {
106
107
  let text = '';
107
108
  let pos = 0;
108
109
  let page_offset = 0;
109
110
  while (pos < buffer.length) {
110
111
  let code = buffer[pos++];
111
- if (code < 0x20) {
112
- if (code >= 0x0E) {
113
- mode = code;
114
- page_offset = (mode - 0x0E) << 7;
115
- }
116
- else if (code > 0x08) {
117
- text += String.fromCodePoint(code);
118
- }
119
- else if (code === 0x08) {
120
- mode = 0x08;
121
- page_offset = 0;
122
- }
123
- else {
124
- mode = code;
125
- page_offset = mode << 15;
126
- }
112
+ if (code < 0x80) {
113
+ if (mode < 0x9C)
114
+ code |= buffer[pos++] << 7;
115
+ if (mode === 0x97)
116
+ code |= buffer[pos++] << 15;
117
+ text += String.fromCodePoint(page_offset + code);
127
118
  }
128
- else if (code < 0x80) {
129
- text += String.fromCodePoint(code);
119
+ else if (code < 0x97) {
120
+ text += fast_char[code - 0x80];
121
+ }
122
+ else if (code >= 0x9C) {
123
+ mode = code;
124
+ page_offset = (mode - 0x9C) << 7;
125
+ }
126
+ else if (code === 0x97) {
127
+ mode = code;
128
+ page_offset = 0;
130
129
  }
131
130
  else {
132
- code &= 0x7F;
133
- if (mode <= 0x08)
134
- code |= buffer[pos++] << 7;
135
- if (mode === 0x08)
136
- code |= buffer[pos++] << 15;
137
- text += String.fromCodePoint(page_offset | code);
131
+ mode = code;
132
+ page_offset = ((mode - 0x98) << 15) + 0x20_00;
138
133
  }
139
134
  }
140
135
  return text;
package/web.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["-","../../../../../mam.ts","../../../../../mol/charset/buffer/buffer.ts","../../../../../mol/charset/ucf/encode/encode.ts","../../../../../mol/charset/ucf/decode/decode.ts"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;;ACHA,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;AAK3B,IAAU,CAAC,CAQV;AARD,WAAU,CAAC;AAQX,CAAC,EARS,CAAC,KAAD,CAAC,QAQV;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;;;ADflB;AACA;AACA;;;;;;;;;;;;;;;AEFA,IAAU,CAAC,CAUV;AAVD,WAAU,CAAC;IAEV,IAAI,GAAG,GAAG,IAAI,UAAU,CAAE,CAAC,IAAE,EAAE,CAAE,CAAA;IAGjC,SAAgB,mBAAmB,CAAE,IAAY;QAChD,IAAI,GAAG,CAAC,UAAU,GAAG,IAAI;YAAG,GAAG,GAAG,IAAI,UAAU,CAAE,IAAI,CAAE,CAAA;QACxD,OAAO,GAAG,CAAA;IACX,CAAC;IAHe,qBAAmB,sBAGlC,CAAA;AAEF,CAAC,EAVS,CAAC,KAAD,CAAC,QAUV;;;;ACVD,IAAU,CAAC,CAwDV;AAxDD,WAAU,CAAC;IAEV,IAAI,GAAG,GAAG,IAAI,UAAU,CAAE,CAAC,IAAE,EAAE,CAAE,CAAA;IAGjC,SAAgB,uBAAuB,CAAE,GAAW;QACnD,MAAM,GAAG,GAAG,mBAAmB,CAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAE,CAAA;QACjD,OAAO,GAAG,CAAC,KAAK,CAAE,CAAC,EAAE,0BAA0B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,QA8CV;;","sourcesContent":[null,"Error.stackTraceLimit = 50;\n\ndeclare let _$_: { new(): {} } & typeof globalThis\ndeclare class $ extends _$_ {}\n\nnamespace $ {\n\texport type $ = typeof $$\n\texport declare class $$ extends $ {\n\t\tstatic $: $\n\t}\n\tnamespace $$ {\n\t\texport type $$ = $\n\t}\n}\n\nmodule.exports = $\n","namespace $ {\n\t\n\tlet buf = new Uint8Array( 2**12 ) // 4KB Mem Page\n\t\n\t/** Temporary buffer. Recursive usage isn't supported. */\n\texport function $mol_charset_buffer( size: number ) {\n\t\tif( buf.byteLength < size ) buf = new Uint8Array( size )\n\t\treturn buf\n\t}\n\t\n}\n","namespace $ {\n\t\n\tlet buf = new Uint8Array( 2**12 ) // 4KB Mem Page\n\n\t/** Encode text to Unicode Compact Format. */\n\texport function $mol_charset_ucf_encode( str: string ) {\n\t\tconst buf = $mol_charset_buffer( str.length * 3 )\n\t\treturn buf.slice( 0, $mol_charset_ucf_encode_to( str, buf ) )\n\t}\n\n\tfunction $mol_charset_ucf_encode_to( str: string, buf: Uint8Array< ArrayBuffer >, from = 0 ) {\n\n\t\tlet pos = from\n\t\tlet mode = 0xF\n\n\t\tfor( let i = 0; i < str.length; i++ ) {\n\t\t\t\n\t\t\tlet code = str.charCodeAt( i )\n\t\t\tif( code >= 0xd800 && code < 0xe000 ) code = ( ( code - 0xd800 ) << 10 ) + str.charCodeAt( ++ i ) + 0x2400\n\t\t\t\n\t\t\tif( code < 0x20 ) {\n\t\t\t\t\n\t\t\t\tif( code > 0x08 && code < 0x0E ) { // ASCII Printable\n\t\t\t\t\tbuf[ pos ++ ] = code\n\t\t\t\t} else { // ASCII Invisible\n\t\t\t\t\tif( mode !== 0x0E ) buf[ pos ++ ] = mode = 0x0E\n\t\t\t\t\tbuf[ pos ++ ] = code | 0x80\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tif( code < 0xFF ) { // ASCII Latin\n\t\t\t\t\tbuf[ pos ++ ] = code\n\t\t\t\t} else if( code < 0x09_00 ) { // Tiny\n\t\t\t\t\tconst page = ( code >> 7 ) + 0x0E\n\t\t\t\t\tif( mode !== page ) buf[ pos ++ ] = mode = page\n\t\t\t\t\tbuf[ pos ++ ] = ( code & 0x7F ) | 0x80\n\t\t\t\t} else if( code < 0x04_00_00 ) { // Wide\n\t\t\t\t\tconst page = code >> 15\n\t\t\t\t\tif( mode !== page ) buf[ pos ++ ] = mode = page\n\t\t\t\t\tbuf[ pos ++ ] = ( code & 0x7F ) | 0x80\n\t\t\t\t\tbuf[ pos ++ ] = code >> 7\n\t\t\t\t} else { // Full\n\t\t\t\t\tif( mode !== 0x08 ) buf[ pos ++ ] = mode = 0x08\n\t\t\t\t\tbuf[ pos ++ ] = ( code & 0x7F ) | 0x80\n\t\t\t\t\tbuf[ pos ++ ] = code >> 7\n\t\t\t\t\tbuf[ pos ++ ] = code >> 15\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\n\t\treturn pos - from\n\t}\n\t\n}\n","namespace $ {\n\n\t/** Decode text from Unicode Compact Format. */\n\texport function $mol_charset_ucf_decode( buffer: Uint8Array< ArrayBuffer >, mode = 0x0F ) {\n\t\t\n\t\tlet text = ''\n\t\tlet pos = 0\n\t\tlet page_offset = 0\n\t\t\n\t\twhile( pos < buffer.length ) {\n\t\t\t\n\t\t\tlet code = buffer[ pos ++ ]\n\t\t\t\n\t\t\tif( code < 0x20 ) {\n\t\t\t\t\n\t\t\t\tif( code >= 0x0E ) {\n\t\t\t\t\tmode = code\n\t\t\t\t\tpage_offset = ( mode - 0x0E ) << 7\n\t\t\t\t} else if( code > 0x08 ) {\n\t\t\t\t\ttext += String.fromCodePoint( code )\n\t\t\t\t} else if( code === 0x08 ) {\n\t\t\t\t\tmode = 0x08\n\t\t\t\t\tpage_offset = 0\n\t\t\t\t} else {\n\t\t\t\t\tmode = code\n\t\t\t\t\tpage_offset = mode << 15\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if( code < 0x80 ) {\n\t\t\t\t\n\t\t\t\ttext += String.fromCodePoint( code )\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tcode &= 0x7F\n\t\t\t\tif( mode <= 0x08 ) code |= buffer[ pos ++ ] << 7\n\t\t\t\tif( mode === 0x08 ) code |= buffer[ pos ++ ] << 15\n\t\t\t\ttext += String.fromCodePoint( page_offset | code )\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn text\n\t}\n\n}\n"]}
1
+ {"version":3,"sources":["-","../../../../../mam.ts","../../../../../mol/charset/buffer/buffer.ts","../../../../../mol/charset/ucf/encode/encode.ts","../../../../../mol/charset/ucf/decode/decode.ts"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;;ACHA,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;AAK3B,IAAU,CAAC,CAQV;AARD,WAAU,CAAC;AAQX,CAAC,EARS,CAAC,KAAD,CAAC,QAQV;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;;;ADflB;AACA;AACA;;;;;;;;;;;;;;;AEFA,IAAU,CAAC,CAUV;AAVD,WAAU,CAAC;IAEV,IAAI,GAAG,GAAG,IAAI,UAAU,CAAE,CAAC,IAAE,EAAE,CAAE,CAAA;IAGjC,SAAgB,mBAAmB,CAAE,IAAY;QAChD,IAAI,GAAG,CAAC,UAAU,GAAG,IAAI;YAAG,GAAG,GAAG,IAAI,UAAU,CAAE,IAAI,CAAE,CAAA;QACxD,OAAO,GAAG,CAAA;IACX,CAAC;IAHe,qBAAmB,sBAGlC,CAAA;AAEF,CAAC,EAVS,CAAC,KAAD,CAAC,QAUV;;;;ACVD,IAAU,CAAC,CA2DV;AA3DD,WAAU,CAAC;IAGV,SAAgB,uBAAuB,CAAE,GAAW;QACnD,MAAM,GAAG,GAAG,mBAAmB,CAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAE,CAAA;QACjD,OAAO,GAAG,CAAC,KAA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;QAEF,CAAC;QAED,OAAO,IAAI,CAAA;IACZ,CAAC;IAxCe,yBAAuB,0BAwCtC,CAAA;AAEF,CAAC,EA/CS,CAAC,KAAD,CAAC,QA+CV;;","sourcesContent":[null,"Error.stackTraceLimit = 50;\n\ndeclare let _$_: { new(): {} } & typeof globalThis\ndeclare class $ extends _$_ {}\n\nnamespace $ {\n\texport type $ = typeof $$\n\texport declare class $$ extends $ {\n\t\tstatic $: $\n\t}\n\tnamespace $$ {\n\t\texport type $$ = $\n\t}\n}\n\nmodule.exports = $\n","namespace $ {\n\t\n\tlet buf = new Uint8Array( 2**12 ) // 4KB Mem Page\n\t\n\t/** Temporary buffer. Recursive usage isn't supported. */\n\texport function $mol_charset_buffer( size: number ) {\n\t\tif( buf.byteLength < size ) buf = new Uint8Array( size )\n\t\treturn buf\n\t}\n\t\n}\n","namespace $ {\n\t\n\t/** Encode text to Unicode Compact Format. */\n\texport function $mol_charset_ucf_encode( str: string ) {\n\t\tconst buf = $mol_charset_buffer( str.length * 3 )\n\t\treturn buf.slice( 0, $mol_charset_ucf_encode_to( str, buf ) )\n\t}\n\t\n\tconst fast_char = `0123456789.,:;()?!-'\" \\n`\n\tconst fast_map = new Array( 0x80 ).fill( 0 )\n\tfor( let i = 0; i < fast_char.length; ++i ) fast_map[ fast_char[ i ].charCodeAt(0) ] = i | 0x80\n\n\texport function $mol_charset_ucf_encode_to( str: string, buf: Uint8Array< ArrayBuffer >, from = 0 ) {\n\n\t\tlet pos = from\n\t\tlet mode = 0x9C\n\n\t\tfor( let i = 0; i < str.length; i++ ) {\n\t\t\t\n\t\t\tlet code = str.charCodeAt( i )\n\t\t\tif( code >= 0xd800 && code < 0xe000 ) code = ( ( code - 0xd800 ) << 10 ) + str.charCodeAt( ++ i ) + 0x2400\n\t\t\t\n\t\t\tif( code < 0x80 ) { // ASCII\n\t\t\t\t\n\t\t\t\tif( mode !== 0x9C ) {\n\t\t\t\t\tconst fast = fast_map[ code ]\n\t\t\t\t\tif( fast ) code = fast\n\t\t\t\t\telse buf[ pos ++ ] = mode = 0x9C\n\t\t\t\t}\n\t\t\t\tbuf[ pos ++ ] = code\n\t\t\t\t\n\t\t\t} else if( code < 0x32_00 ) { // Tiny\n\t\t\t\t\n\t\t\t\tconst page = ( code >> 7 ) + 0x9C\n\t\t\t\tif( mode !== page ) buf[ pos ++ ] = mode = page\n\t\t\t\tbuf[ pos ++ ] = code & 0x7F\n\t\t\t\t\n\t\t\t} else if( code < 0x04_20_00 ) { // Wide\n\t\t\t\t\n\t\t\t\tcode -= 0x2000\n\t\t\t\tconst page = ( code >> 15 ) + 0x98\n\t\t\t\tif( mode !== page ) buf[ pos ++ ] = mode = page\n\t\t\t\tbuf[ pos ++ ] = code & 0x7F\n\t\t\t\tbuf[ pos ++ ] = code >> 7\n\t\t\t\t\n\t\t\t} else { // Full\n\t\t\t\t\n\t\t\t\tif( mode !== 0x97 ) buf[ pos ++ ] = mode = 0x97\n\t\t\t\tbuf[ pos ++ ] = code & 0x7F\n\t\t\t\tbuf[ pos ++ ] = code >> 7\n\t\t\t\tbuf[ pos ++ ] = code >> 15\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\n\t\treturn pos - from\n\t}\n\t\n}\n","namespace $ {\n\n\tconst fast_char = `0123456789.,:;()?!-'\" \\n`\n\t\n\t/** Decode text from Unicode Compact Format. */\n\texport function $mol_charset_ucf_decode( buffer: Uint8Array< ArrayBuffer >, mode = 0x9C ) {\n\t\t\n\t\tlet text = ''\n\t\tlet pos = 0\n\t\tlet page_offset = 0\n\t\t\n\t\twhile( pos < buffer.length ) {\n\t\t\t\n\t\t\tlet code = buffer[ pos ++ ]\n\t\t\t\n\t\t\tif( code < 0x80 ) { // Char Code\n\t\t\t\t\n\t\t\t\tif( mode < 0x9C ) code |= buffer[ pos ++ ] << 7\n\t\t\t\tif( mode === 0x97 ) code |= buffer[ pos ++ ] << 15\n\t\t\t\ttext += String.fromCodePoint( page_offset + code )\n\t\t\t\t\n\t\t\t} else if( code < 0x97 ) { // ASCII\n\t\t\t\t\n\t\t\t\ttext += fast_char[ code - 0x80 ]\n\t\t\t\t\n\t\t\t} else if( code >= 0x9C ) { // Tiny Set\n\t\t\t\t\n\t\t\t\tmode = code\n\t\t\t\tpage_offset = ( mode - 0x9C ) << 7\n\t\t\t\t\n\t\t\t} else if( code === 0x97 ) { // Full Set\n\t\t\t\t\n\t\t\t\tmode = code\n\t\t\t\tpage_offset = 0\n\t\t\t\t\n\t\t\t} else { // Wide Set\n\t\t\t\t\n\t\t\t\tmode = code\n\t\t\t\tpage_offset = ( ( mode - 0x98 ) << 15 ) + 0x20_00\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn text\n\t}\n\n}\n"]}
package/web.mjs CHANGED
@@ -45,96 +45,91 @@ var $;
45
45
  "use strict";
46
46
  var $;
47
47
  (function ($) {
48
- let buf = new Uint8Array(2 ** 12);
49
48
  function $mol_charset_ucf_encode(str) {
50
49
  const buf = $mol_charset_buffer(str.length * 3);
51
50
  return buf.slice(0, $mol_charset_ucf_encode_to(str, buf));
52
51
  }
53
52
  $.$mol_charset_ucf_encode = $mol_charset_ucf_encode;
53
+ const fast_char = `0123456789.,:;()?!-'" \n`;
54
+ const fast_map = new Array(0x80).fill(0);
55
+ for (let i = 0; i < fast_char.length; ++i)
56
+ fast_map[fast_char[i].charCodeAt(0)] = i | 0x80;
54
57
  function $mol_charset_ucf_encode_to(str, buf, from = 0) {
55
58
  let pos = from;
56
- let mode = 0xF;
59
+ let mode = 0x9C;
57
60
  for (let i = 0; i < str.length; i++) {
58
61
  let code = str.charCodeAt(i);
59
62
  if (code >= 0xd800 && code < 0xe000)
60
63
  code = ((code - 0xd800) << 10) + str.charCodeAt(++i) + 0x2400;
61
- if (code < 0x20) {
62
- if (code > 0x08 && code < 0x0E) {
63
- buf[pos++] = code;
64
- }
65
- else {
66
- if (mode !== 0x0E)
67
- buf[pos++] = mode = 0x0E;
68
- buf[pos++] = code | 0x80;
64
+ if (code < 0x80) {
65
+ if (mode !== 0x9C) {
66
+ const fast = fast_map[code];
67
+ if (fast)
68
+ code = fast;
69
+ else
70
+ buf[pos++] = mode = 0x9C;
69
71
  }
72
+ buf[pos++] = code;
73
+ }
74
+ else if (code < 0x32_00) {
75
+ const page = (code >> 7) + 0x9C;
76
+ if (mode !== page)
77
+ buf[pos++] = mode = page;
78
+ buf[pos++] = code & 0x7F;
79
+ }
80
+ else if (code < 0x04_20_00) {
81
+ code -= 0x2000;
82
+ const page = (code >> 15) + 0x98;
83
+ if (mode !== page)
84
+ buf[pos++] = mode = page;
85
+ buf[pos++] = code & 0x7F;
86
+ buf[pos++] = code >> 7;
70
87
  }
71
88
  else {
72
- if (code < 0xFF) {
73
- buf[pos++] = code;
74
- }
75
- else if (code < 0x09_00) {
76
- const page = (code >> 7) + 0x0E;
77
- if (mode !== page)
78
- buf[pos++] = mode = page;
79
- buf[pos++] = (code & 0x7F) | 0x80;
80
- }
81
- else if (code < 0x04_00_00) {
82
- const page = code >> 15;
83
- if (mode !== page)
84
- buf[pos++] = mode = page;
85
- buf[pos++] = (code & 0x7F) | 0x80;
86
- buf[pos++] = code >> 7;
87
- }
88
- else {
89
- if (mode !== 0x08)
90
- buf[pos++] = mode = 0x08;
91
- buf[pos++] = (code & 0x7F) | 0x80;
92
- buf[pos++] = code >> 7;
93
- buf[pos++] = code >> 15;
94
- }
89
+ if (mode !== 0x97)
90
+ buf[pos++] = mode = 0x97;
91
+ buf[pos++] = code & 0x7F;
92
+ buf[pos++] = code >> 7;
93
+ buf[pos++] = code >> 15;
95
94
  }
96
95
  }
97
96
  return pos - from;
98
97
  }
98
+ $.$mol_charset_ucf_encode_to = $mol_charset_ucf_encode_to;
99
99
  })($ || ($ = {}));
100
100
 
101
101
  ;
102
102
  "use strict";
103
103
  var $;
104
104
  (function ($) {
105
- function $mol_charset_ucf_decode(buffer, mode = 0x0F) {
105
+ const fast_char = `0123456789.,:;()?!-'" \n`;
106
+ function $mol_charset_ucf_decode(buffer, mode = 0x9C) {
106
107
  let text = '';
107
108
  let pos = 0;
108
109
  let page_offset = 0;
109
110
  while (pos < buffer.length) {
110
111
  let code = buffer[pos++];
111
- if (code < 0x20) {
112
- if (code >= 0x0E) {
113
- mode = code;
114
- page_offset = (mode - 0x0E) << 7;
115
- }
116
- else if (code > 0x08) {
117
- text += String.fromCodePoint(code);
118
- }
119
- else if (code === 0x08) {
120
- mode = 0x08;
121
- page_offset = 0;
122
- }
123
- else {
124
- mode = code;
125
- page_offset = mode << 15;
126
- }
112
+ if (code < 0x80) {
113
+ if (mode < 0x9C)
114
+ code |= buffer[pos++] << 7;
115
+ if (mode === 0x97)
116
+ code |= buffer[pos++] << 15;
117
+ text += String.fromCodePoint(page_offset + code);
127
118
  }
128
- else if (code < 0x80) {
129
- text += String.fromCodePoint(code);
119
+ else if (code < 0x97) {
120
+ text += fast_char[code - 0x80];
121
+ }
122
+ else if (code >= 0x9C) {
123
+ mode = code;
124
+ page_offset = (mode - 0x9C) << 7;
125
+ }
126
+ else if (code === 0x97) {
127
+ mode = code;
128
+ page_offset = 0;
130
129
  }
131
130
  else {
132
- code &= 0x7F;
133
- if (mode <= 0x08)
134
- code |= buffer[pos++] << 7;
135
- if (mode === 0x08)
136
- code |= buffer[pos++] << 15;
137
- text += String.fromCodePoint(page_offset | code);
131
+ mode = code;
132
+ page_offset = ((mode - 0x98) << 15) + 0x20_00;
138
133
  }
139
134
  }
140
135
  return text;
package/web.test.js CHANGED
@@ -1460,11 +1460,12 @@ var $;
1460
1460
  (function ($$) {
1461
1461
  $mol_test({
1462
1462
  "Complex UCF encoding"($) {
1463
- $mol_assert_equal($mol_charset_ucf_encode('hi мир, 你好 世界 🏴‍☠\t\n'), new Uint8Array([
1463
+ $mol_assert_equal($mol_charset_ucf_encode('hi мир, 美しい 世界 🏴‍☠\t\n'), new Uint8Array([
1464
1464
  0x68, 0x69, 0x20,
1465
- 0x16, 0xBC, 0xB8, 0xC0, 0x2C, 0x20,
1466
- 0x00, 0xE0, 0x9E, 0xFD, 0xB2, 0x20, 0x96, 0x9C, 0xCC, 0xEA, 0x20,
1467
- 0x03, 0xF4, 0xE7, 0x00, 0x8D, 0x40, 0xA0, 0x4C, 0x09, 0x0A,
1465
+ 0xA4, 0x3C, 0x38, 0x40, 0x8B, 0x95,
1466
+ 0x98, 0x0E, 0xBF, 0xFC, 0x57, 0x44, 0x95,
1467
+ 0x98, 0x16, 0x5C, 0x4C, 0xAA, 0x95,
1468
+ 0x9B, 0x74, 0xA7, 0xDC, 0x0D, 0xE8, 0x20, 0x9C, 0x09, 0x0A,
1468
1469
  ]));
1469
1470
  },
1470
1471
  });
@@ -1479,11 +1480,12 @@ var $;
1479
1480
  (function ($$) {
1480
1481
  $mol_test({
1481
1482
  "Complex UCF eecoding"($) {
1482
- $mol_assert_equal('hi мир, 你好 世界 🏴‍☠\t\n', $mol_charset_ucf_decode(new Uint8Array([
1483
+ $mol_assert_equal('hi мир, 美しい 世界 🏴‍☠\t\n', $mol_charset_ucf_decode(new Uint8Array([
1483
1484
  0x68, 0x69, 0x20,
1484
- 0x16, 0xBC, 0xB8, 0xC0, 0x2C, 0x20,
1485
- 0x00, 0xE0, 0x9E, 0xFD, 0xB2, 0x20, 0x96, 0x9C, 0xCC, 0xEA, 0x20,
1486
- 0x03, 0xF4, 0xE7, 0x00, 0x8D, 0x40, 0xA0, 0x4C, 0x09, 0x0A,
1485
+ 0xA4, 0x3C, 0x38, 0x40, 0x8B, 0x95,
1486
+ 0x98, 0x0E, 0xBF, 0xFC, 0x57, 0x44, 0x95,
1487
+ 0x98, 0x16, 0x5C, 0x4C, 0xAA, 0x95,
1488
+ 0x9B, 0x74, 0xA7, 0xDC, 0x0D, 0xE8, 0x20, 0x9C, 0x09, 0x0A,
1487
1489
  ])));
1488
1490
  },
1489
1491
  });