@atproto/lex-cbor 0.0.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/dist/encoding.d.ts +6 -0
- package/dist/encoding.d.ts.map +1 -0
- package/dist/index.cjs.js +1707 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +1703 -0
- package/package.json +52 -0
- package/src/encoding.ts +101 -0
- package/src/index.ts +73 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { sha256 as hasher } from 'multiformats/hashes/sha2';
|
|
2
|
+
import { CID, LexValue } from '@atproto/lex-data';
|
|
3
|
+
export { CID, hasher };
|
|
4
|
+
export { decode, decodeAll, encode } from './encoding.js';
|
|
5
|
+
export type { LexValue };
|
|
6
|
+
export declare function cidForLex(value: LexValue): Promise<CID>;
|
|
7
|
+
export declare function cidForCbor(bytes: Uint8Array): Promise<CID>;
|
|
8
|
+
export declare function verifyCidForBytes(cid: CID, bytes: Uint8Array): Promise<void>;
|
|
9
|
+
export declare function cidForRawBytes(bytes: Uint8Array): Promise<CID>;
|
|
10
|
+
export declare function cidForRawHash(hash: Uint8Array): CID;
|
|
11
|
+
/**
|
|
12
|
+
* @note Only supports DASL CIDs
|
|
13
|
+
* @see {@link https://dasl.ing/cid.html}
|
|
14
|
+
* @throws if the input do not represent a valid DASL {@link CID}
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseCidFromBytes(cidBytes: Uint8Array): CID;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EACL,GAAG,EAEH,QAAQ,EAGT,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA;AACtB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACzD,YAAY,EAAE,QAAQ,EAAE,CAAA;AAExB,wBAAsB,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAE7D;AAED,wBAAsB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAGhE;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,iBAQlE;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAGpE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,GAAG,CAGnD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,UAAU,GAAG,GAAG,CAuB3D"}
|