@dotrino/content 0.6.0 → 0.6.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/lib/public.js +1 -4
- package/package.json +6 -6
package/lib/public.js
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import { isValidCid } from './ref.js'
|
|
22
|
+
import { cidOf } from './cid.js'
|
|
22
23
|
|
|
23
24
|
/** Nombre del canal de un dueño dentro de un proxio (espejo de src/announce.js). */
|
|
24
25
|
export const channelFor = (nodeId, ownerId) => `${nodeId}/content_${ownerId}`
|
|
@@ -34,10 +35,6 @@ export const FETCH_MAX_BYTES = 256 * 1024
|
|
|
34
35
|
|
|
35
36
|
const b64ToBytes = (s) => /** @type {Uint8Array<ArrayBuffer>} */ (Uint8Array.from(atob(s), (c) => c.charCodeAt(0)))
|
|
36
37
|
|
|
37
|
-
async function cidOf (bytes) {
|
|
38
|
-
const digest = await crypto.subtle.digest('SHA-256', bytes)
|
|
39
|
-
return 'sha256-' + [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, '0')).join('')
|
|
40
|
-
}
|
|
41
38
|
|
|
42
39
|
const err = (code, msg) => Object.assign(new Error(msg), { code })
|
|
43
40
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/content",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Nodo de contenido del ecosistema Dotrino: guarda los bytes del usuario direccionados por su hash (cid), en su propia maquina y, si el dueno quiere, respaldados en su propio bucket (R2, Backblaze, Hetzner, Storj o S3). Lo publico sale por URL directa; lo privado, cifrado y solo por la red Dotrino.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"typescript": "5.9.3"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@dotrino/identity": "0.
|
|
27
|
-
"@dotrino/proxy-client": "0.36.
|
|
28
|
-
"@dotrino/remote-agent": "0.
|
|
29
|
-
"@dotrino/update": "0.
|
|
30
|
-
"@dotrino/vault": "0.
|
|
26
|
+
"@dotrino/identity": "0.120.0",
|
|
27
|
+
"@dotrino/proxy-client": "0.36.2",
|
|
28
|
+
"@dotrino/remote-agent": "0.22.0",
|
|
29
|
+
"@dotrino/update": "0.9.0",
|
|
30
|
+
"@dotrino/vault": "0.90.3"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
33
33
|
"dotrino",
|