min-mphash 0.5.0
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/README.en.md +321 -0
- package/README.md +335 -0
- package/README.zh.md +323 -0
- package/dist/MinMPHash.d.ts +140 -0
- package/dist/MinMPLookup.d.ts +115 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +937 -0
- package/dist/util.d.ts +26 -0
- package/package.json +37 -0
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IMinMPHashDict } from "./MinMPHash";
|
|
2
|
+
export declare function writeVarInt(val: number, buffer: number[] | Uint8Array, offset?: number): number;
|
|
3
|
+
export declare function readVarInt(buffer: Uint8Array, offset: number): {
|
|
4
|
+
value: number;
|
|
5
|
+
bytes: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function dictToCBOR(dict: IMinMPHashDict): Uint8Array;
|
|
8
|
+
export declare function dictFromCBOR(bin: Uint8Array): IMinMPHashDict;
|
|
9
|
+
export declare function compressIBinary(data: Uint8Array): Promise<Uint8Array>;
|
|
10
|
+
export declare function decompressIBinary(data: Uint8Array): Promise<Uint8Array>;
|
|
11
|
+
export declare class BitWriter {
|
|
12
|
+
private buffer;
|
|
13
|
+
private currentByte;
|
|
14
|
+
private bitCount;
|
|
15
|
+
write(value: number, bits: number): void;
|
|
16
|
+
flush(): void;
|
|
17
|
+
getData(): Uint8Array;
|
|
18
|
+
}
|
|
19
|
+
export declare class BitReader {
|
|
20
|
+
private buffer;
|
|
21
|
+
private byteOffset;
|
|
22
|
+
private bitOffset;
|
|
23
|
+
constructor(buffer: Uint8Array);
|
|
24
|
+
read(bits: number): number;
|
|
25
|
+
}
|
|
26
|
+
export declare function readBitsAt(buffer: Uint8Array, bitOffset: number, bitLength: number): number;
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "min-mphash",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"author": "git@qzrzz.com",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/qzrzz/MinMPHash#readme",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"README.zh.md",
|
|
19
|
+
"README.en.md"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "rslib build",
|
|
23
|
+
"dev": "rslib build --watch",
|
|
24
|
+
"test": "bun test"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@rslib/core": "^0.18.6",
|
|
28
|
+
"@types/node": "^22",
|
|
29
|
+
"typescript": "^5.9.3"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@types/bun": "1.3.5"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"registry": "https://registry.npmjs.org"
|
|
36
|
+
}
|
|
37
|
+
}
|