Index worker is a cloudflare worker that generates an index for a CAR file.
Index a key in the bucket.
Returns newline delimited dag-json. e.g.
// [multihash, [offset, length]]
[{"/":{"bytes":"EiANNuDDCZUo8wPAjW9/pSog/UoPdP6RllJIloT4PCHxaA"}},[98,1048576]]
[{"/":{"bytes":"EiBgL8yuPQqboDoblfIsgDeJCvDsKKLX7SrdUSnk1QboGQ"}},[1048713,79616]]
[{"/":{"bytes":"EiBhK/1XBIQzPT6Cd7CYvKokGp0hRrXcVU7CV0LRxswWDQ"}},[1128367,108]]Note: supports ?offset= querystring parameter. This allows indexing of HUGE DAGs. Use stat call (below) to get full size of the file. Next, track the last received offset if the response ends before the offset reaches the end of the file you need to make an additional request with the ?offset= parameter.
Get the size in bytes of a given key.
Returns JSON. e.g.
{"size":1128475}Get the bytes of the given key.
Note: Supports HTTP Range header.
Compute sha2-256 hash for the key.
Returns dag-json. e.g.
{"/":{"bytes":"EiDWta59x/xP90v+TdAt1HWcxjGrQSp4ikNkWkgOM8zfVw"}}