ssbc / ssb-bfe

Binary Field Encodings (BFE) for Secure Scuttlebutt (SSB)
3 stars 1 forks source link

decode(buffer, { toURI: true }) #14

Open mixmix opened 3 years ago

mixmix commented 3 years ago

with the conversation about the best string implementation of each of these type-formats (TFs), it seems like some of the new TFs are going to be represented by SSB-URIs by default... so we are going to need to handle that with decode as well.

we could optionally map existing TFs to SSB-URI instead of sigil based too (we'll likely end up supporting both for completeness)

We could extend the bfe.json with recipes for each URI, but it would be much nicer if we could make it ssb:${typeName}/${formatName}/${key}

mixmix commented 3 years ago

I'm aware you've already laid out some bendy butt URIs. I wonder if we could make it so that the typeName and formatName in bfe.json would line up with that?

mixmix commented 3 years ago

went looking for those bb URIs but couldn't find references to them

BTW this is the spec for URIs (for reference) : https://github.com/ssb-ngi-pointer/ssb-uri-spec

mixmix commented 2 years ago

BUMP - found myself needing this

use-case - wanting to encode a blob ID plus its unbox, mimeType etc in a URI. was hoping this module could help but not quite.