britram / borat Goto Github PK
View Code? Open in Web Editor NEWCBOR encoding and decoding library supporting tags, integer object keys, and canonicalization
License: MIT License
CBOR encoding and decoding library supporting tags, integer object keys, and canonicalization
License: MIT License
CBORReader
needs a way to implement object size limits (e.g., for parser DoS defense). Add a limit
field to the CBORReader
struct, start counting against the limit when a "top-level" read begins, and return an error when the limit is exceeded.
If a struct like the following is passed to the Unmarshaler, then it is unclear as to how the unmarshaler would know which concrete type to fill into the struct field:
type ConvolutedIndirectable interface {
ConvolutedIndirection() int
}
type Indirector struct {
I int
}
func (i *Indirector) ConvolutedIndirection() int {
return i.I
}
type One struct {
A ConvolutedIndirectable
}
func main() {
reader := ...
var o One
if err := reader.Unmarshal(&o); err != nil {
...
}
}
When the struct is marshaled the information about what struct was actually in the interface is lost, only an un-type-annotated map is transferred via CBOR, so it does not seem possible to work out what type to create to put in this field when unmarshaling.
The struct cache should not have to learn the struct each time it unmarshals it (possibly recursively), just store the global struct name in a cache and retrieve it from there each time or create it once and put it there.
see §2.2 of RFC7011
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.