Sprites Binary Media Storage
A binary blob lives in the data store as one record with two fields: its id and a data object. The metadata is the meta record beside it under the same id. The data object holds the blob: a length, the count of bytes, and bytes, a flat list of that many byte values. Each byte is one integer from 0 to 255. The blob belongs to every machine, so it carries a machine, mode or palette.
{
"id": "5e2a9c1740b84d6fa1c3e08b62d5f907",
"data": {
"length": 256,
"bytes": [ "... 256 byte values, each 0 to 255 ..." ]
}
}
id and the data object. The bytes list holds length entries, in order from the first byte.Data
The data object carries the byte count and the bytes themselves.
| Field | Type | Description |
|---|---|---|
length | Number | The count of bytes, and the length of the bytes list. |
bytes | Array | The byte values in order. Each is one integer from 0 to 255. The byte at address i is at index i. |
Full example
A four byte blob: the letters H and i, then two zero bytes. The letter H is code 72, the letter i is code 105.
{
"length": 4,
"bytes": [ 72, 105, 0, 0 ]
}