IF Commons GitHub

physical/blob

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-anyfs-githost-store FR-007

What a revision is made of and what a blob of Git is: the revision of some bytes is sha256: and their digest (the same text as in every other store of AnyFS, so a bridge compares across stores), and the name of a blob in Git is the SHA-1 of blob <size> and a NUL before its bytes, which is what lets a store tell that a host gave the bytes the name stands for. The revisions are kept by the name of the blob: what a name stands for never changes, so a digest kept for a name (in store.ts) is always right.

Source: commons/anyfs-githost/src/physical/blob.ts

0 of 3 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

gitBlobIdfunctionno test imports it
function gitBlobId(bytes: Uint8Array<ArrayBufferLike>): Promise<string>

The name Git gives a blob of these bytes (SHA-1), which is the name a host gives it in a repository of the usual kind.

isBlobfunctionno test imports it
function isBlob(id: string, bytes: Uint8Array<ArrayBufferLike>): Promise<boolean>

Whether bytes are what a blob name stands for: true where the name is of another kind (a repository of SHA-256 names) and so cannot be told.

revisionOffunctionno test imports it
function revisionOf(bytes: Uint8Array<ArrayBufferLike>): Promise<Revision>

The revision of some bytes: sha256: and their digest.

Titles, headings, exports, tables, columns and requirements. Esc closes.