@iscc/lib 0.0.2
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.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @iscc/lib
|
|
2
|
+
|
|
3
|
+
[](https://github.com/iscc/iscc-lib/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@iscc/lib)
|
|
5
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
|
+
|
|
7
|
+
> **Experimental:** This library is in early development (v0.0.x). APIs may change without notice.
|
|
8
|
+
> Not recommended for production use yet.
|
|
9
|
+
|
|
10
|
+
High-performance Node.js bindings for [ISO 24138:2024](https://www.iso.org/standard/77899.html) --
|
|
11
|
+
International Standard Content Code (ISCC). Native addon built with Rust and
|
|
12
|
+
[napi-rs](https://napi.rs/) for near-native speed.
|
|
13
|
+
|
|
14
|
+
## What is ISCC
|
|
15
|
+
|
|
16
|
+
The ISCC is a similarity-preserving fingerprint and identifier for digital media assets. ISCCs are
|
|
17
|
+
generated algorithmically from digital content, just like cryptographic hashes. However, instead of
|
|
18
|
+
using a single cryptographic hash function to identify data only, the ISCC uses various algorithms
|
|
19
|
+
to create a composite identifier that exhibits similarity-preserving properties (soft hash).
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @iscc/lib
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
const {
|
|
31
|
+
gen_meta_code_v0
|
|
32
|
+
} = require("@iscc/lib");
|
|
33
|
+
|
|
34
|
+
const iscc = gen_meta_code_v0("ISCC Test Document!");
|
|
35
|
+
console.log(`Meta-Code: ${iscc}`);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## API Overview
|
|
39
|
+
|
|
40
|
+
### Code Generators
|
|
41
|
+
|
|
42
|
+
| Function | Description |
|
|
43
|
+
| ---------------------- | -------------------------------------------- |
|
|
44
|
+
| `gen_meta_code_v0` | Generate a Meta-Code from metadata fields |
|
|
45
|
+
| `gen_text_code_v0` | Generate a Text-Code from plain text |
|
|
46
|
+
| `gen_image_code_v0` | Generate an Image-Code from pixel data |
|
|
47
|
+
| `gen_audio_code_v0` | Generate an Audio-Code from Chromaprint data |
|
|
48
|
+
| `gen_video_code_v0` | Generate a Video-Code from frame signatures |
|
|
49
|
+
| `gen_mixed_code_v0` | Generate a Mixed-Code from Content-Codes |
|
|
50
|
+
| `gen_data_code_v0` | Generate a Data-Code from a Buffer |
|
|
51
|
+
| `gen_instance_code_v0` | Generate an Instance-Code from a Buffer |
|
|
52
|
+
| `gen_iscc_code_v0` | Generate a composite ISCC-CODE |
|
|
53
|
+
|
|
54
|
+
All code generators return ISCC strings directly.
|
|
55
|
+
|
|
56
|
+
### Utilities
|
|
57
|
+
|
|
58
|
+
- **Text processing:** `text_clean`, `text_remove_newlines`, `text_trim`, `text_collapse`
|
|
59
|
+
- **Algorithm primitives:** `alg_simhash`, `alg_minhash_256`, `alg_cdc_chunks`, `sliding_window`
|
|
60
|
+
- **Soft hashing:** `soft_hash_video_v0`
|
|
61
|
+
- **Encoding:** `encode_base64`
|
|
62
|
+
- **Codec:** `iscc_decompose`
|
|
63
|
+
- **Streaming:** `DataHasher`, `InstanceHasher` classes for incremental processing
|
|
64
|
+
- **Diagnostics:** `conformance_selftest`
|
|
65
|
+
|
|
66
|
+
## Links
|
|
67
|
+
|
|
68
|
+
- [Documentation](https://lib.iscc.codes)
|
|
69
|
+
- [Repository](https://github.com/iscc/iscc-lib)
|
|
70
|
+
- [ISCC Specification (ISO 24138)](https://www.iso.org/standard/77899.html)
|
|
71
|
+
- [ISCC Foundation](https://iscc.io)
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
Apache-2.0
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@iscc/lib",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/iscc/iscc-lib"
|
|
8
|
+
},
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"types": "index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"index.js",
|
|
13
|
+
"index.d.ts",
|
|
14
|
+
"*.node",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"napi": {
|
|
18
|
+
"name": "iscc-lib",
|
|
19
|
+
"triples": {
|
|
20
|
+
"defaults": true,
|
|
21
|
+
"additional": [
|
|
22
|
+
"aarch64-unknown-linux-gnu"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "napi build --platform --release",
|
|
28
|
+
"build:debug": "napi build --platform",
|
|
29
|
+
"test": "node --test __tests__/*.test.mjs"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@napi-rs/cli": "^3"
|
|
33
|
+
},
|
|
34
|
+
"optionalDependencies": {
|
|
35
|
+
"@iscc/lib-darwin-x64": "0.0.2",
|
|
36
|
+
"@iscc/lib-darwin-arm64": "0.0.2",
|
|
37
|
+
"@iscc/lib-win32-x64-msvc": "0.0.2",
|
|
38
|
+
"@iscc/lib-linux-x64-gnu": "0.0.2",
|
|
39
|
+
"@iscc/lib-linux-arm64-gnu": "0.0.2"
|
|
40
|
+
}
|
|
41
|
+
}
|