@ryantest/openclaw-qqbot 0.0.1
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/LICENSE +22 -0
- package/README.md +483 -0
- package/README.zh.md +478 -0
- package/bin/qqbot-cli.js +243 -0
- package/clawdbot.plugin.json +16 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +26 -0
- package/dist/src/admin-resolver.d.ts +27 -0
- package/dist/src/admin-resolver.js +122 -0
- package/dist/src/api.d.ts +156 -0
- package/dist/src/api.js +599 -0
- package/dist/src/channel.d.ts +11 -0
- package/dist/src/channel.js +354 -0
- package/dist/src/config.d.ts +25 -0
- package/dist/src/config.js +161 -0
- package/dist/src/credential-backup.d.ts +31 -0
- package/dist/src/credential-backup.js +66 -0
- package/dist/src/gateway.d.ts +18 -0
- package/dist/src/gateway.js +1265 -0
- package/dist/src/image-server.d.ts +68 -0
- package/dist/src/image-server.js +462 -0
- package/dist/src/inbound-attachments.d.ts +58 -0
- package/dist/src/inbound-attachments.js +234 -0
- package/dist/src/known-users.d.ts +100 -0
- package/dist/src/known-users.js +263 -0
- package/dist/src/message-queue.d.ts +50 -0
- package/dist/src/message-queue.js +115 -0
- package/dist/src/onboarding.d.ts +10 -0
- package/dist/src/onboarding.js +203 -0
- package/dist/src/outbound-deliver.d.ts +48 -0
- package/dist/src/outbound-deliver.js +462 -0
- package/dist/src/outbound.d.ts +203 -0
- package/dist/src/outbound.js +1102 -0
- package/dist/src/proactive.d.ts +170 -0
- package/dist/src/proactive.js +399 -0
- package/dist/src/ref-index-store.d.ts +70 -0
- package/dist/src/ref-index-store.js +273 -0
- package/dist/src/reply-dispatcher.d.ts +35 -0
- package/dist/src/reply-dispatcher.js +311 -0
- package/dist/src/runtime.d.ts +3 -0
- package/dist/src/runtime.js +10 -0
- package/dist/src/session-store.d.ts +52 -0
- package/dist/src/session-store.js +254 -0
- package/dist/src/slash-commands.d.ts +71 -0
- package/dist/src/slash-commands.js +1179 -0
- package/dist/src/startup-greeting.d.ts +30 -0
- package/dist/src/startup-greeting.js +78 -0
- package/dist/src/stt.d.ts +21 -0
- package/dist/src/stt.js +70 -0
- package/dist/src/tools/channel.d.ts +16 -0
- package/dist/src/tools/channel.js +234 -0
- package/dist/src/tools/remind.d.ts +2 -0
- package/dist/src/tools/remind.js +247 -0
- package/dist/src/types.d.ts +175 -0
- package/dist/src/types.js +1 -0
- package/dist/src/typing-keepalive.d.ts +27 -0
- package/dist/src/typing-keepalive.js +64 -0
- package/dist/src/update-checker.d.ts +34 -0
- package/dist/src/update-checker.js +166 -0
- package/dist/src/user-messages.d.ts +8 -0
- package/dist/src/user-messages.js +8 -0
- package/dist/src/utils/audio-convert.d.ts +89 -0
- package/dist/src/utils/audio-convert.js +704 -0
- package/dist/src/utils/file-utils.d.ts +55 -0
- package/dist/src/utils/file-utils.js +150 -0
- package/dist/src/utils/image-size.d.ts +51 -0
- package/dist/src/utils/image-size.js +234 -0
- package/dist/src/utils/media-tags.d.ts +14 -0
- package/dist/src/utils/media-tags.js +164 -0
- package/dist/src/utils/payload.d.ts +112 -0
- package/dist/src/utils/payload.js +186 -0
- package/dist/src/utils/platform.d.ts +137 -0
- package/dist/src/utils/platform.js +390 -0
- package/dist/src/utils/text-parsing.d.ts +32 -0
- package/dist/src/utils/text-parsing.js +80 -0
- package/dist/src/utils/upload-cache.d.ts +34 -0
- package/dist/src/utils/upload-cache.js +93 -0
- package/index.ts +31 -0
- package/moltbot.plugin.json +16 -0
- package/node_modules/@eshaz/web-worker/LICENSE +201 -0
- package/node_modules/@eshaz/web-worker/README.md +134 -0
- package/node_modules/@eshaz/web-worker/browser.js +17 -0
- package/node_modules/@eshaz/web-worker/cjs/browser.js +16 -0
- package/node_modules/@eshaz/web-worker/cjs/node.js +219 -0
- package/node_modules/@eshaz/web-worker/index.d.ts +4 -0
- package/node_modules/@eshaz/web-worker/node.js +223 -0
- package/node_modules/@eshaz/web-worker/package.json +54 -0
- package/node_modules/@wasm-audio-decoders/common/index.js +5 -0
- package/node_modules/@wasm-audio-decoders/common/package.json +36 -0
- package/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderCommon.js +231 -0
- package/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderWorker.js +129 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/README +67 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/build_puff.js +31 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/puff.c +863 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/puff.h +35 -0
- package/node_modules/@wasm-audio-decoders/common/src/utilities.js +3 -0
- package/node_modules/@wasm-audio-decoders/common/types.d.ts +7 -0
- package/node_modules/mpg123-decoder/README.md +265 -0
- package/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js +185 -0
- package/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js.map +1 -0
- package/node_modules/mpg123-decoder/index.js +8 -0
- package/node_modules/mpg123-decoder/package.json +58 -0
- package/node_modules/mpg123-decoder/src/EmscriptenWasm.js +464 -0
- package/node_modules/mpg123-decoder/src/MPEGDecoder.js +200 -0
- package/node_modules/mpg123-decoder/src/MPEGDecoderWebWorker.js +21 -0
- package/node_modules/mpg123-decoder/types.d.ts +30 -0
- package/node_modules/silk-wasm/LICENSE +21 -0
- package/node_modules/silk-wasm/README.md +85 -0
- package/node_modules/silk-wasm/lib/index.cjs +16 -0
- package/node_modules/silk-wasm/lib/index.d.ts +70 -0
- package/node_modules/silk-wasm/lib/index.mjs +16 -0
- package/node_modules/silk-wasm/lib/silk.wasm +0 -0
- package/node_modules/silk-wasm/lib/utils.d.ts +4 -0
- package/node_modules/silk-wasm/package.json +39 -0
- package/node_modules/simple-yenc/.github/FUNDING.yml +1 -0
- package/node_modules/simple-yenc/.prettierignore +1 -0
- package/node_modules/simple-yenc/LICENSE +7 -0
- package/node_modules/simple-yenc/README.md +163 -0
- package/node_modules/simple-yenc/dist/esm.js +1 -0
- package/node_modules/simple-yenc/dist/index.js +1 -0
- package/node_modules/simple-yenc/package.json +50 -0
- package/node_modules/simple-yenc/rollup.config.js +27 -0
- package/node_modules/simple-yenc/src/simple-yenc.js +302 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +13 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/ws/lib/receiver.js +706 -0
- package/node_modules/ws/lib/sender.js +602 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +554 -0
- package/node_modules/ws/lib/websocket.js +1393 -0
- package/node_modules/ws/package.json +69 -0
- package/node_modules/ws/wrapper.mjs +8 -0
- package/openclaw.plugin.json +16 -0
- package/package.json +76 -0
- package/scripts/cleanup-legacy-plugins.sh +124 -0
- package/scripts/proactive-api-server.ts +369 -0
- package/scripts/send-proactive.ts +293 -0
- package/scripts/set-markdown.sh +156 -0
- package/scripts/test-sendmedia.ts +116 -0
- package/scripts/upgrade-via-alt-pkg.sh +307 -0
- package/scripts/upgrade-via-npm.ps1 +296 -0
- package/scripts/upgrade-via-npm.sh +301 -0
- package/scripts/upgrade-via-source.sh +774 -0
- package/skills/qqbot-channel/SKILL.md +263 -0
- package/skills/qqbot-channel/references/api_references.md +521 -0
- package/skills/qqbot-media/SKILL.md +56 -0
- package/skills/qqbot-remind/SKILL.md +149 -0
- package/src/admin-resolver.ts +140 -0
- package/src/api.ts +819 -0
- package/src/bot-logs-2026-03-21T11-21-47(2).txt +46 -0
- package/src/channel.ts +381 -0
- package/src/config.ts +187 -0
- package/src/credential-backup.ts +72 -0
- package/src/gateway.log +43 -0
- package/src/gateway.ts +1404 -0
- package/src/image-server.ts +539 -0
- package/src/inbound-attachments.ts +304 -0
- package/src/known-users.ts +353 -0
- package/src/message-queue.ts +169 -0
- package/src/onboarding.ts +274 -0
- package/src/openclaw-2026-03-21.log +3729 -0
- package/src/openclaw-plugin-sdk.d.ts +522 -0
- package/src/outbound-deliver.ts +552 -0
- package/src/outbound.ts +1266 -0
- package/src/proactive.ts +530 -0
- package/src/ref-index-store.ts +357 -0
- package/src/reply-dispatcher.ts +334 -0
- package/src/runtime.ts +14 -0
- package/src/session-store.ts +303 -0
- package/src/slash-commands.ts +1305 -0
- package/src/startup-greeting.ts +98 -0
- package/src/stt.ts +86 -0
- package/src/tools/channel.ts +281 -0
- package/src/tools/remind.ts +296 -0
- package/src/types.ts +183 -0
- package/src/typing-keepalive.ts +59 -0
- package/src/update-checker.ts +179 -0
- package/src/user-messages.ts +7 -0
- package/src/utils/audio-convert.ts +803 -0
- package/src/utils/file-utils.ts +167 -0
- package/src/utils/image-size.ts +266 -0
- package/src/utils/media-tags.ts +182 -0
- package/src/utils/payload.ts +265 -0
- package/src/utils/platform.ts +435 -0
- package/src/utils/text-parsing.ts +82 -0
- package/src/utils/upload-cache.ts +128 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# `simple-yenc`
|
|
2
|
+
|
|
3
|
+
`simple-yenc` is a minimalist yEnc and dynEncode encoder and decoder ECMAScript library for browser and NodeJS.
|
|
4
|
+
|
|
5
|
+
This library is designed to be simple to use and is optimized for size so that inclusion in a browser based application has very little impact.
|
|
6
|
+
|
|
7
|
+
## What is yEnc?
|
|
8
|
+
|
|
9
|
+
yEnc, or yEncode, is a very space efficient method of binary encoding. yEnc's overhead is around 1–2%,
|
|
10
|
+
compared to 33%–40% overhead for 6-bit encoding methods like Base64. yEnc has 252 of the 256 possible bytes available for use for encoding. NUL, LF, CR, and = are the only escaped characters.
|
|
11
|
+
|
|
12
|
+
### Read More
|
|
13
|
+
http://www.yenc.org/whatis.htm
|
|
14
|
+
|
|
15
|
+
## What is dynEncode?
|
|
16
|
+
|
|
17
|
+
dynEncode, or Dynamic Encode is an encoding scheme that dynamically selects the most efficient byte offset depending incoming data and the required escape characters. This encoding scheme is meant to be the most efficient encoding scheme given a set of escape characters and input data. Generally, it is a few percentage points more efficient than yEnc.
|
|
18
|
+
|
|
19
|
+
The only required escape character is `=`, which is used to denote an escaped value. Any other characters may or may not be escaped in the string depending on the destination's escape requirements.
|
|
20
|
+
|
|
21
|
+
Dynamic encoded strings have a configurable byte offset that is selected when the data is encoded. This offset shifts the encoded data around to avoid characters that must be escaped. For example, yEnc's offset is hardcoded to 42, whereas dynEncode can select an offset of 0-255 (all possible offsets).
|
|
22
|
+
|
|
23
|
+
Dynamic encoded strings are prepended with the below metadata that describes the parameters needed to decode the string into binary.
|
|
24
|
+
|
|
25
|
+
### **`dynEncode` Format**
|
|
26
|
+
Bytes | Name | Range | Description
|
|
27
|
+
------|--------------|-------------------------------|--------------------------------------------------------------------------
|
|
28
|
+
00-08 | Signature | `dynEncode` | Magic signature identifying the string as a dynEncode string.
|
|
29
|
+
09-10 | Version | `0x00-0xFE` (`0xFF` reserved) | Base-16 string describing the version of dynEncode.
|
|
30
|
+
|
|
31
|
+
#### Version 0
|
|
32
|
+
Bytes | Name | Range | Description
|
|
33
|
+
------|--------------|-------------|--------------------------------------------------------------------------
|
|
34
|
+
00-08 | Signature | `dynEncode` | Magic signature identifying the string as a dynEncode string.
|
|
35
|
+
09-10 | Version | `0x00` | Base-16 string describing the version of dynEncode.
|
|
36
|
+
11-12 | Byte Offset | `0x00-0xFF` | Base-16 string describing the byte offset used when encoding.
|
|
37
|
+
13-xx | Encoded Data | ... | Data contained in the dynEncode string.
|
|
38
|
+
|
|
39
|
+
#### Current Version (Version 1)
|
|
40
|
+
Bytes | Name | Range | Description
|
|
41
|
+
------|-------------- | --------------------------|--------------------------------------------------------------------------
|
|
42
|
+
00-08 | Signature | `dynEncode` | Magic signature identifying the string as a dynEncode string.
|
|
43
|
+
09-10 | Version | `0x01` | Base-16 string describing the version of dynEncode.
|
|
44
|
+
11-12 | Byte Offset | `0x00-0xFF` | Base-16 string describing the byte offset used when encoding.
|
|
45
|
+
13-20 | CRC 32 checksum | `0x00000000`-`0xFFFFFFFF` | Base-16 string encoding a 32bit signed integer (little endian) describing the checksum of the encoded data. <br> The checksum is validated during the decode process.
|
|
46
|
+
21-xx | Encoded Data | ... | Data contained in the dynEncode string.
|
|
47
|
+
|
|
48
|
+
*dynEncode (Dynamic Encode), the above encoding scheme, and included implementation are copyright © 2022 Ethan Halsall and are licensed under the conditions of the [MIT License](https://github.com/eshaz/simple-yenc/blob/master/LICENSE).*
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
Install via [NPM](https://www.npmjs.com/package/simple-yenc)
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
// NodeJS
|
|
56
|
+
const yenc = require("simple-yenc");
|
|
57
|
+
|
|
58
|
+
// ES6 Import
|
|
59
|
+
import * as yenc from "simple-yenc";
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### `encode()`
|
|
63
|
+
|
|
64
|
+
Encodes a Uint8Array, or array of integers 0-255, to a yEnc encoded string.
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
// assuming `dataToEncode` is already defined
|
|
68
|
+
|
|
69
|
+
const encodedString = yenc.encode(dataToEncode);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### `dynamicEncode()`
|
|
73
|
+
|
|
74
|
+
Encodes a Uint8Array, or array of integers 0-255, to a dynEncoded string.
|
|
75
|
+
|
|
76
|
+
This function will iterate over the incoming data 255 times to select the byte offset with the least amount of overhead. Encoding may be relatively slow for large input data.
|
|
77
|
+
|
|
78
|
+
This function only encodes the current version
|
|
79
|
+
|
|
80
|
+
#### Parameters
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
// assuming `dataToEncode` and `stringContainerCharacter` are already defined
|
|
84
|
+
|
|
85
|
+
const encodedString = yenc.encode(dataToEncode, stringContainerCharacter);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
* First Parameter
|
|
89
|
+
* `Array` of integers 0-255 of data to encode
|
|
90
|
+
* Second Parameter *optional* **default: `"`**
|
|
91
|
+
* `string` representing the character used to declare the string the data will be stored. Escape characters are selected automatically base on JavaScript string escape requirements depending on this value.
|
|
92
|
+
* Valid parameter values: ``` ` ``` (backtick), `"` (double quote), `'` (single quote)
|
|
93
|
+
* Third Parameter *optional* **default: `yenc.crc32`**
|
|
94
|
+
* CRC32 Function that is used to calculate the checksum.
|
|
95
|
+
* The function must implement the `CRC32Function` interface
|
|
96
|
+
|
|
97
|
+
### `decode()`
|
|
98
|
+
|
|
99
|
+
Decodes a yEnc or dynEnc encoded string into a Uint8Array.
|
|
100
|
+
|
|
101
|
+
Note: If you are embedding the yEnc string in HTML, this function will automatically handle the [HTML character reference overrides](https://html.spec.whatwg.org/multipage/parsing.html#table-charref-overrides). The HTML `charset` must be set to a character encoding that allows for single byte character representations such as `cp1252`, `ISO-8859-1`, etc. See [Issue #1](https://github.com/eshaz/simple-yenc/issues/1) for more information.
|
|
102
|
+
|
|
103
|
+
This function decodes all version of dynEnc strings.
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
// assuming `encodedString` is already defined
|
|
107
|
+
|
|
108
|
+
const decodedUint8Array = yenc.decode(encodedString);
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
* First Parameter
|
|
112
|
+
* `string` yenc or dynEnc string
|
|
113
|
+
* Second Parameter *optional* **default: `yenc.crc32`**
|
|
114
|
+
* CRC32 Function that was used to calculate the checksum for the dynamicEncoded string.
|
|
115
|
+
* The function must implement the `CRC32Function` interface
|
|
116
|
+
|
|
117
|
+
### `stringify()`
|
|
118
|
+
|
|
119
|
+
Stringify adds escape characters for ```'\', '`', '${'``` to a yEnc encoded string so it can be stored within a Javascript string template.
|
|
120
|
+
|
|
121
|
+
You can access the encoded value as a string using [``` String.raw`` ```](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw).
|
|
122
|
+
|
|
123
|
+
This is useful for inlining binary in Javascript that would otherwise need to be base64 encoded.
|
|
124
|
+
|
|
125
|
+
When stored as a Javascript string, the string can be decoded by using the `decode` function.
|
|
126
|
+
|
|
127
|
+
```javascript
|
|
128
|
+
// assuming `dataToEncode` is already defined
|
|
129
|
+
|
|
130
|
+
const encodedString = yenc.encode(dataToEncode);
|
|
131
|
+
const stringified = yenc.strinfigy(encodedString);
|
|
132
|
+
|
|
133
|
+
fs.writeFileSync(
|
|
134
|
+
"myfile.js",
|
|
135
|
+
Buffer.concat(
|
|
136
|
+
["const encodedBinary = `", stringified, "`"].map(Buffer.from)
|
|
137
|
+
),
|
|
138
|
+
{ encoding: "binary" }
|
|
139
|
+
);
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### `crc32()`
|
|
143
|
+
|
|
144
|
+
Default CRC32 function that calculates the checksum for dynamicEncoded strings.
|
|
145
|
+
|
|
146
|
+
Adapted from [GCC](https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=libiberty/crc32.c;hb=refs/heads/master).
|
|
147
|
+
|
|
148
|
+
This CRC can be specified as:
|
|
149
|
+
* Width: `32`
|
|
150
|
+
* Poly: `0x04c11db7`
|
|
151
|
+
* Init: `0xffffffff`
|
|
152
|
+
* RefIn: `false`
|
|
153
|
+
* RefOut `false`
|
|
154
|
+
* XorOut `0`
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
// CRC32 Function Interface
|
|
158
|
+
(
|
|
159
|
+
buf: Uint8Array,
|
|
160
|
+
init: number = 0xffffffff,
|
|
161
|
+
poly: number = 0x04c11db7
|
|
162
|
+
) => CRC32Function
|
|
163
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=(t,n=4294967295,e=79764919)=>{const r=new Int32Array(256);let o,s,i,c=n;for(o=0;o<256;o++){for(i=o<<24,s=8;s>0;--s)i=2147483648&i?i<<1^e:i<<1;r[o]=i}for(o=0;o<t.length;o++)c=c<<8^r[255&(c>>24^t[o])];return c},n=t=>{const n=[];for(const e of t){let t=(e+42)%256;0===t||10===t||13===t||61===t?n.push("="+String.fromCharCode((t+64)%256)):n.push(String.fromCharCode(t))}return n.join("")},e=(n,e=t)=>{const r=t=>new Uint8Array(t.length/2).map(((n,e)=>parseInt(t.substring(2*e,2*(e+1)),16))),o=t=>r(t)[0],s=new Map;[,8364,,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,,381,,,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,,382,376].forEach(((t,n)=>s.set(t,n)));const i=new Uint8Array(n.length);let c,a,l,f=!1,g=0,h=42,p=n.length>13&&"dynEncode"===n.substring(0,9),u=0;p&&(u=11,a=o(n.substring(9,u)),a<=1&&(u+=2,h=o(n.substring(11,u))),1===a&&(u+=8,l=(t=>new DataView(r(t).buffer).getInt32(0,!0))(n.substring(13,u))));const d=256-h;for(let t=u;t<n.length;t++)if(c=n.charCodeAt(t),61!==c||f){if(92===c&&t<n.length-5&&p){const e=n.charCodeAt(t+1);117!==e&&85!==e||(c=parseInt(n.substring(t+2,t+6),16),t+=5)}if(c>255){const t=s.get(c);t&&(c=t+127)}f&&(f=!1,c-=64),i[g++]=c<h&&c>0?c+d:c-h}else f=!0;const m=i.subarray(0,g);if(p&&1===a){const t=e(m);if(t!==l){const n="Decode failed crc32 validation";throw console.error("`simple-yenc`\n",n+"\n","Expected: "+l+"; Got: "+t+"\n","Visit https://github.com/eshaz/simple-yenc for more information"),Error(n)}}return m},r=(n,e='"',r=t,o)=>{const s=(t,n)=>(t%n+n)%n,i=(t,n)=>n.push(String.fromCharCode(61,(t+64)%256)),c=t=>t.map((t=>t.toString(16).padStart(2,"0")));let a,l,f=[],g=1/0,h=Array(256).fill(0);if('"'===e?(l=[0,8,9,10,11,12,13,34,92,61],a=t=>0===t||8===t||9===t||10===t||11===t||12===t||13===t||34===t||92===t||61===t):"'"===e?(l=[0,8,9,10,11,12,13,39,92,61],a=t=>0===t||8===t||9===t||10===t||11===t||12===t||13===t||39===t||92===t||61===t):"`"===e&&(l=[13,61,96],f=[7,205,231],a=(t,n)=>13===t||36===t&&123===n||61===t||92===t&&(85===n||117===n)||96===t),void 0===o){o=0;for(let t=0;t<n.length;t++){const e=0|n[t];h[e]++;for(let r=0;r<f.length;r++){const o=f[r];s(e-n[t+1]|0,256)===o&&h[e]++}}for(let t=0;t<256;t++){let n=0;for(let e=0;e<l.length;e++)n+=h[s(l[e]-t,256)];n<g&&(g=n,o=t)}}const p=["dynEncode","01",c([o]),...c((t=>{const n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),[...n]})(r(n)))];for(let t=0;t<n.length;t++){const e=(n[t]+o)%256;a(e,(n[t+1]+o)%256)?i(e,p):p.push(String.fromCharCode(e))}return"\\"===p[p.length-1]&&(p.pop(),i(92,p)),p.join("")},o=t=>t.replace(/[\\]/g,"\\\\").replace(/[`]/g,"\\`").replace(/\${/g,"\\${");export{t as crc32,e as decode,r as dynamicEncode,n as encode,o as stringify};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=(t,e=4294967295,r=79764919)=>{const n=new Int32Array(256);let o,s,c,i=e;for(o=0;o<256;o++){for(c=o<<24,s=8;s>0;--s)c=2147483648&c?c<<1^r:c<<1;n[o]=c}for(o=0;o<t.length;o++)i=i<<8^n[255&(i>>24^t[o])];return i};exports.crc32=t,exports.decode=(e,r=t)=>{const n=t=>new Uint8Array(t.length/2).map(((e,r)=>parseInt(t.substring(2*r,2*(r+1)),16))),o=t=>n(t)[0],s=new Map;[,8364,,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,,381,,,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,,382,376].forEach(((t,e)=>s.set(t,e)));const c=new Uint8Array(e.length);let i,a,l,f=!1,g=0,h=42,p=e.length>13&&"dynEncode"===e.substring(0,9),d=0;p&&(d=11,a=o(e.substring(9,d)),a<=1&&(d+=2,h=o(e.substring(11,d))),1===a&&(d+=8,l=(t=>new DataView(n(t).buffer).getInt32(0,!0))(e.substring(13,d))));const u=256-h;for(let t=d;t<e.length;t++)if(i=e.charCodeAt(t),61!==i||f){if(92===i&&t<e.length-5&&p){const r=e.charCodeAt(t+1);117!==r&&85!==r||(i=parseInt(e.substring(t+2,t+6),16),t+=5)}if(i>255){const t=s.get(i);t&&(i=t+127)}f&&(f=!1,i-=64),c[g++]=i<h&&i>0?i+u:i-h}else f=!0;const m=c.subarray(0,g);if(p&&1===a){const t=r(m);if(t!==l){const e="Decode failed crc32 validation";throw console.error("`simple-yenc`\n",e+"\n","Expected: "+l+"; Got: "+t+"\n","Visit https://github.com/eshaz/simple-yenc for more information"),Error(e)}}return m},exports.dynamicEncode=(e,r='"',n=t,o)=>{const s=(t,e)=>(t%e+e)%e,c=(t,e)=>e.push(String.fromCharCode(61,(t+64)%256)),i=t=>t.map((t=>t.toString(16).padStart(2,"0")));let a,l,f=[],g=1/0,h=Array(256).fill(0);if('"'===r?(l=[0,8,9,10,11,12,13,34,92,61],a=t=>0===t||8===t||9===t||10===t||11===t||12===t||13===t||34===t||92===t||61===t):"'"===r?(l=[0,8,9,10,11,12,13,39,92,61],a=t=>0===t||8===t||9===t||10===t||11===t||12===t||13===t||39===t||92===t||61===t):"`"===r&&(l=[13,61,96],f=[7,205,231],a=(t,e)=>13===t||36===t&&123===e||61===t||92===t&&(85===e||117===e)||96===t),void 0===o){o=0;for(let t=0;t<e.length;t++){const r=0|e[t];h[r]++;for(let n=0;n<f.length;n++){const o=f[n];s(r-e[t+1]|0,256)===o&&h[r]++}}for(let t=0;t<256;t++){let e=0;for(let r=0;r<l.length;r++)e+=h[s(l[r]-t,256)];e<g&&(g=e,o=t)}}const p=["dynEncode","01",i([o]),...i((t=>{const e=new Uint8Array(4);return new DataView(e.buffer).setInt32(0,t,!0),[...e]})(n(e)))];for(let t=0;t<e.length;t++){const r=(e[t]+o)%256;a(r,(e[t+1]+o)%256)?c(r,p):p.push(String.fromCharCode(r))}return"\\"===p[p.length-1]&&(p.pop(),c(92,p)),p.join("")},exports.encode=t=>{const e=[];for(const r of t){let t=(r+42)%256;0===t||10===t||13===t||61===t?e.push("="+String.fromCharCode((t+64)%256)):e.push(String.fromCharCode(t))}return e.join("")},exports.stringify=t=>t.replace(/[\\]/g,"\\\\").replace(/[`]/g,"\\`").replace(/\${/g,"\\${");
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "simple-yenc",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "Minimalist yEnc and dynEncode encoder and decoder library for browser and NodeJS",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/esm.js",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"import": "./dist/esm.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "node --experimental-vm-modules node_modules/.bin/jest --maxWorkers=100%",
|
|
17
|
+
"build": "rollup -c --bundleConfigAsCjs",
|
|
18
|
+
"format": "prettier --cache --write '**/*.js' --write 'package.json'"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/eshaz/simple-yenc.git"
|
|
23
|
+
},
|
|
24
|
+
"author": "Ethan Halsall",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/eshaz/simple-yenc/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/eshaz/simple-yenc#readme",
|
|
30
|
+
"funding": {
|
|
31
|
+
"type": "individual",
|
|
32
|
+
"url": "https://github.com/sponsors/eshaz"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"yEnc",
|
|
36
|
+
"yEncode",
|
|
37
|
+
"dynEnc",
|
|
38
|
+
"dynEncode",
|
|
39
|
+
"Dynamic Encode",
|
|
40
|
+
"Binary Encoding"
|
|
41
|
+
],
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
44
|
+
"@types/jest": "^29.5.11",
|
|
45
|
+
"jest": "^29.7.0",
|
|
46
|
+
"prettier": "^3.2.1",
|
|
47
|
+
"rollup": "^4.9.5",
|
|
48
|
+
"simple-yenc": "file:./"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import terser from "@rollup/plugin-terser";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
input: "./src/simple-yenc.js",
|
|
5
|
+
output: [
|
|
6
|
+
{
|
|
7
|
+
file: "dist/esm.js",
|
|
8
|
+
format: "esm",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
file: "dist/index.js",
|
|
12
|
+
format: "cjs",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
plugins: [
|
|
16
|
+
terser({
|
|
17
|
+
compress: {
|
|
18
|
+
ecma: 2021,
|
|
19
|
+
passes: 5,
|
|
20
|
+
toplevel: true,
|
|
21
|
+
unsafe: true,
|
|
22
|
+
unsafe_methods: true,
|
|
23
|
+
unsafe_arrows: true,
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
};
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/* See https://gcc.gnu.org/git/?p=gcc.git;a=blob_plain;f=libiberty/crc32.c;hb=refs/heads/master */
|
|
2
|
+
const crc32 = (buf, init = 0xffffffff, poly = 0x04c11db7) => {
|
|
3
|
+
const crc32Table = new Int32Array(256);
|
|
4
|
+
let i,
|
|
5
|
+
j,
|
|
6
|
+
c,
|
|
7
|
+
crc = init;
|
|
8
|
+
|
|
9
|
+
for (i = 0; i < 256; i++) {
|
|
10
|
+
for (c = i << 24, j = 8; j > 0; --j)
|
|
11
|
+
c = c & 0x80000000 ? (c << 1) ^ poly : c << 1;
|
|
12
|
+
crc32Table[i] = c;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
for (i = 0; i < buf.length; i++)
|
|
16
|
+
crc = (crc << 8) ^ crc32Table[((crc >> 24) ^ buf[i]) & 255];
|
|
17
|
+
|
|
18
|
+
return crc;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const encode = (byteArray) => {
|
|
22
|
+
const charArray = [];
|
|
23
|
+
|
|
24
|
+
for (const byte of byteArray) {
|
|
25
|
+
let encoded = (byte + 42) % 256;
|
|
26
|
+
|
|
27
|
+
if (
|
|
28
|
+
encoded === 0 || // NULL
|
|
29
|
+
encoded === 10 || // LF
|
|
30
|
+
encoded === 13 || // CR
|
|
31
|
+
encoded === 61 // =
|
|
32
|
+
) {
|
|
33
|
+
charArray.push("=" + String.fromCharCode((encoded + 64) % 256));
|
|
34
|
+
} else {
|
|
35
|
+
charArray.push(String.fromCharCode(encoded));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return charArray.join("");
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const decode = (string, crc32Function = crc32) => {
|
|
43
|
+
const stringToBytes = (string) =>
|
|
44
|
+
new Uint8Array(string.length / 2).map((_, i) =>
|
|
45
|
+
parseInt(string.substring(i * 2, (i + 1) * 2), 16),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const hexToUint8 = (string) => stringToBytes(string)[0];
|
|
49
|
+
|
|
50
|
+
const hexToInt32_LE = (string) =>
|
|
51
|
+
new DataView(stringToBytes(string).buffer).getInt32(0, true);
|
|
52
|
+
|
|
53
|
+
const htmlCodeOverrides = new Map();
|
|
54
|
+
[
|
|
55
|
+
,
|
|
56
|
+
8364,
|
|
57
|
+
,
|
|
58
|
+
8218,
|
|
59
|
+
402,
|
|
60
|
+
8222,
|
|
61
|
+
8230,
|
|
62
|
+
8224,
|
|
63
|
+
8225,
|
|
64
|
+
710,
|
|
65
|
+
8240,
|
|
66
|
+
352,
|
|
67
|
+
8249,
|
|
68
|
+
338,
|
|
69
|
+
,
|
|
70
|
+
381,
|
|
71
|
+
,
|
|
72
|
+
,
|
|
73
|
+
8216,
|
|
74
|
+
8217,
|
|
75
|
+
8220,
|
|
76
|
+
8221,
|
|
77
|
+
8226,
|
|
78
|
+
8211,
|
|
79
|
+
8212,
|
|
80
|
+
732,
|
|
81
|
+
8482,
|
|
82
|
+
353,
|
|
83
|
+
8250,
|
|
84
|
+
339,
|
|
85
|
+
,
|
|
86
|
+
382,
|
|
87
|
+
376,
|
|
88
|
+
].forEach((k, v) => htmlCodeOverrides.set(k, v));
|
|
89
|
+
|
|
90
|
+
const output = new Uint8Array(string.length);
|
|
91
|
+
|
|
92
|
+
let escaped = false,
|
|
93
|
+
byteIndex = 0,
|
|
94
|
+
byte,
|
|
95
|
+
offset = 42, // default yEnc offset
|
|
96
|
+
isDynEncode = string.length > 13 && string.substring(0, 9) === "dynEncode",
|
|
97
|
+
dynEncodeVersion,
|
|
98
|
+
startIdx = 0,
|
|
99
|
+
crc;
|
|
100
|
+
|
|
101
|
+
if (isDynEncode) {
|
|
102
|
+
startIdx = 9 + 2;
|
|
103
|
+
dynEncodeVersion = hexToUint8(string.substring(9, startIdx));
|
|
104
|
+
if (dynEncodeVersion <= 1) {
|
|
105
|
+
startIdx += 2;
|
|
106
|
+
offset = hexToUint8(string.substring(11, startIdx));
|
|
107
|
+
}
|
|
108
|
+
if (dynEncodeVersion === 1) {
|
|
109
|
+
startIdx += 8;
|
|
110
|
+
crc = hexToInt32_LE(string.substring(13, startIdx));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const offsetReverse = 256 - offset;
|
|
115
|
+
|
|
116
|
+
for (let i = startIdx; i < string.length; i++) {
|
|
117
|
+
byte = string.charCodeAt(i);
|
|
118
|
+
|
|
119
|
+
if (byte === 61 && !escaped) {
|
|
120
|
+
escaped = true;
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// work around for encoded strings that are UTF escaped
|
|
125
|
+
if (
|
|
126
|
+
byte === 92 && // /
|
|
127
|
+
i < string.length - 5 &&
|
|
128
|
+
isDynEncode
|
|
129
|
+
) {
|
|
130
|
+
const secondCharacter = string.charCodeAt(i + 1);
|
|
131
|
+
|
|
132
|
+
if (
|
|
133
|
+
secondCharacter === 117 || // u
|
|
134
|
+
secondCharacter === 85 // U
|
|
135
|
+
) {
|
|
136
|
+
byte = parseInt(string.substring(i + 2, i + 6), 16);
|
|
137
|
+
i += 5;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (byte > 255) {
|
|
142
|
+
const htmlOverride = htmlCodeOverrides.get(byte);
|
|
143
|
+
if (htmlOverride) byte = htmlOverride + 127;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (escaped) {
|
|
147
|
+
escaped = false;
|
|
148
|
+
byte -= 64;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
output[byteIndex++] =
|
|
152
|
+
byte < offset && byte > 0 ? byte + offsetReverse : byte - offset;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const results = output.subarray(0, byteIndex);
|
|
156
|
+
if (isDynEncode && dynEncodeVersion === 1) {
|
|
157
|
+
const actualCrc = crc32Function(results);
|
|
158
|
+
if (actualCrc !== crc) {
|
|
159
|
+
const error = "Decode failed crc32 validation";
|
|
160
|
+
console.error(
|
|
161
|
+
"`simple-yenc`\n",
|
|
162
|
+
error + "\n",
|
|
163
|
+
"Expected: " + crc + "; Got: " + actualCrc + "\n",
|
|
164
|
+
"Visit https://github.com/eshaz/simple-yenc for more information",
|
|
165
|
+
);
|
|
166
|
+
throw new Error(error);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return results;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const dynamicEncode = (
|
|
174
|
+
byteArray,
|
|
175
|
+
stringWrapper = '"',
|
|
176
|
+
crc32Function = crc32,
|
|
177
|
+
offset,
|
|
178
|
+
) => {
|
|
179
|
+
const modulo = (n, m) => ((n % m) + m) % m,
|
|
180
|
+
escapeCharacter = (byte1, charArray) =>
|
|
181
|
+
charArray.push(String.fromCharCode(61, (byte1 + 64) % 256));
|
|
182
|
+
|
|
183
|
+
const bytesToHex = (bytes) =>
|
|
184
|
+
bytes.map((byte) => byte.toString(16).padStart(2, "0"));
|
|
185
|
+
|
|
186
|
+
const int32ToUint8_LE = (i32) => {
|
|
187
|
+
const u8 = new Uint8Array(4);
|
|
188
|
+
new DataView(u8.buffer).setInt32(0, i32, true);
|
|
189
|
+
return [...u8];
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
let shouldEscape,
|
|
193
|
+
escapeBytes,
|
|
194
|
+
byteSequences = [],
|
|
195
|
+
offsetLength = Infinity,
|
|
196
|
+
byteCounts = Array(256).fill(0);
|
|
197
|
+
|
|
198
|
+
if (stringWrapper === '"') {
|
|
199
|
+
escapeBytes = [0, 8, 9, 10, 11, 12, 13, 34, 92, 61];
|
|
200
|
+
shouldEscape = (byte1) =>
|
|
201
|
+
byte1 === 0 || // NULL
|
|
202
|
+
byte1 === 8 || // BS
|
|
203
|
+
byte1 === 9 || // TAB
|
|
204
|
+
byte1 === 10 || // LF
|
|
205
|
+
byte1 === 11 || // VT
|
|
206
|
+
byte1 === 12 || // FF
|
|
207
|
+
byte1 === 13 || // CR
|
|
208
|
+
byte1 === 34 || // "
|
|
209
|
+
byte1 === 92 || // \
|
|
210
|
+
byte1 === 61; // =;
|
|
211
|
+
} else if (stringWrapper === "'") {
|
|
212
|
+
escapeBytes = [0, 8, 9, 10, 11, 12, 13, 39, 92, 61];
|
|
213
|
+
shouldEscape = (byte1) =>
|
|
214
|
+
byte1 === 0 || // NULL
|
|
215
|
+
byte1 === 8 || // BS
|
|
216
|
+
byte1 === 9 || // TAB
|
|
217
|
+
byte1 === 10 || // LF
|
|
218
|
+
byte1 === 11 || // VT
|
|
219
|
+
byte1 === 12 || // FF
|
|
220
|
+
byte1 === 13 || // CR
|
|
221
|
+
byte1 === 39 || // '
|
|
222
|
+
byte1 === 92 || // \
|
|
223
|
+
byte1 === 61; // =;
|
|
224
|
+
} else if (stringWrapper === "`") {
|
|
225
|
+
escapeBytes = [13, 61, 96];
|
|
226
|
+
byteSequences = [7, 205, 231];
|
|
227
|
+
shouldEscape = (byte1, byte2) =>
|
|
228
|
+
byte1 === 13 || // CR
|
|
229
|
+
(byte1 === 36 && byte2 === 123) || // ${
|
|
230
|
+
byte1 === 61 || // =
|
|
231
|
+
(byte1 === 92 && (byte2 === 85 || byte2 === 117)) || // \u or \U
|
|
232
|
+
byte1 === 96; // `
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (offset === undefined) {
|
|
236
|
+
offset = 0;
|
|
237
|
+
|
|
238
|
+
// collect the number of bytes for the offset search
|
|
239
|
+
for (let i = 0; i < byteArray.length; i++) {
|
|
240
|
+
const byte1 = byteArray[i] | 0;
|
|
241
|
+
|
|
242
|
+
byteCounts[byte1]++;
|
|
243
|
+
|
|
244
|
+
for (let j = 0; j < byteSequences.length; j++) {
|
|
245
|
+
const byteSequence = byteSequences[j];
|
|
246
|
+
|
|
247
|
+
// for the backtick escape, there are sequences of bytes that need to be escaped
|
|
248
|
+
// check if this byte sequence is the same and add to the length count if so
|
|
249
|
+
if (modulo((byte1 - byteArray[i + 1]) | 0, 256) === byteSequence)
|
|
250
|
+
byteCounts[byte1]++;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// search for the byte offset with the least amount of escape characters
|
|
255
|
+
for (let o = 0; o < 256; o++) {
|
|
256
|
+
let length = 0;
|
|
257
|
+
|
|
258
|
+
// for each escape byte, add the byte counts collected above
|
|
259
|
+
for (let i = 0; i < escapeBytes.length; i++)
|
|
260
|
+
length += byteCounts[modulo(escapeBytes[i] - o, 256)];
|
|
261
|
+
|
|
262
|
+
// if the current offset results in a smaller length, use that
|
|
263
|
+
if (length < offsetLength) {
|
|
264
|
+
offsetLength = length;
|
|
265
|
+
offset = o;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const charArray = [
|
|
271
|
+
"dynEncode", // magic signature
|
|
272
|
+
"01", // version 0x00 - 0xfe (0xff reserved)
|
|
273
|
+
bytesToHex([offset]), // best offset in bytes 0x00 - 0xff
|
|
274
|
+
...bytesToHex(int32ToUint8_LE(crc32Function(byteArray))), // crc32
|
|
275
|
+
];
|
|
276
|
+
|
|
277
|
+
for (let i = 0; i < byteArray.length; i++) {
|
|
278
|
+
const byte1 = (byteArray[i] + offset) % 256;
|
|
279
|
+
const byte2 = (byteArray[i + 1] + offset) % 256;
|
|
280
|
+
|
|
281
|
+
shouldEscape(byte1, byte2)
|
|
282
|
+
? escapeCharacter(byte1, charArray)
|
|
283
|
+
: charArray.push(String.fromCharCode(byte1));
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// correct edge case where escape character is at end of string
|
|
287
|
+
if (charArray[charArray.length - 1] === "\\") {
|
|
288
|
+
charArray.pop();
|
|
289
|
+
escapeCharacter(92, charArray);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return charArray.join("");
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
// allows embedded javascript string template
|
|
296
|
+
const stringify = (rawString) =>
|
|
297
|
+
rawString
|
|
298
|
+
.replace(/[\\]/g, "\\\\")
|
|
299
|
+
.replace(/[`]/g, "\\`")
|
|
300
|
+
.replace(/\${/g, "\\${");
|
|
301
|
+
|
|
302
|
+
export { encode, dynamicEncode, decode, stringify, crc32 };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
|
|
2
|
+
Copyright (c) 2013 Arnout Kazemier and contributors
|
|
3
|
+
Copyright (c) 2016 Luigi Pinca and contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|