A hidim is a torrent that is embedded inside of a 24-bit png. The data portion of a hidim does not need to fill the image.
Torrent data is read upward and to the right.
The torrent is broken up into 3-byte segments, and each segment represents red, green, and blue channels in a pixel.
Each hidim is identified by the hidim key:
[104, 105, 100, 105, 109, 32, 105, 115, 32, 116, 111, 114, 114, 101, 110, 116, 115, 33]
This byte array identifies the image as a hidim and marks the start of hidim data. The hidim reader starts at the hidim key, reads the metadata to determine the column height and data length, then reads column-by-column to the right until the data length has been reached.
Metadata is similar to bencoding and has the following attributes:
- line length -- bencoded integer
- filename -- bencoded string
- sha1 hash of .torrent file -- bencoded string
- data -- bencoded string
Example metadata:
i28304e14:ubuntu.torrent40:f572d396fae9206628714fb2ce00f72e94f2258f
Metadata is stacked together without separators. The data follows immediately after the metadata.