dedis / fixbuf Goto Github PK
View Code? Open in Web Editor NEWFixed length binary encoding of arbitrary structures in Go
License: GNU Lesser General Public License v3.0
Fixed length binary encoding of arbitrary structures in Go
License: GNU Lesser General Public License v3.0
When deserializing a slice, the slice must already be allocated to the right size. Put it in another way, the length is not transmitted in the fixbuf encoding.
While in itself, this is not problem, I envision that the usability is greatly reduced because of that. Imagine a complex hierarchy of structure, it would be impractical to instantiate every intermediate structure to "just" allocate a slice to the right slice.
Therefore, I'd like to raise the question whether we should embed the length of any slice in the encoding.
In a function like "func (r typeX) UnmarshalFrom() { r.X = 1 }" the caller will not see r.X == 1, because the modifications happen on the value created by pass by value.
However, if I make a custom-marshalling type using a pointer receiver, then it is never called. If I use a value receiver it is called. This might be because encoding.go:81 calls UnmarshalFrom without having a pointer.
Anyway, it seems to me that custom unmarshalling does not work now.
Hiyo!
It appears that this code is also used in Kyber which has the MPL license: https://github.com/dedis/kyber/blob/master/LICENSE . I assume that the Kyber license is probably the intended license (since it's a bigger project). Do you think you could re-release this project as MPL as well?
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.