Comments (1)
Ok guys I'm almost there. I added some padding to the end after each field and now things align. But for some reason array elements get pushed up one.
Also what's up with the single space and plus sign on the last character of the strings?
// new deserialization code. note I'm using u8 because that is the format used by the rust program
const archive_id = lo.cstr("archive_id"); const created_on = lo.cstr("created_on"); const dataStruct = lo.struct( [archive_id, lo.seq(lo.u8(), 3), created_on, lo.seq(lo.u8(), 3)], "ChatMessage" ); const ds = lo.seq(dataStruct, CHAT_MESSAGE_ELEMENTS_COUNT); const messages = ds.decode(sentAccount.data);
from buffer-layout.
Related Issues (20)
- Add factory functions for Structure, Union, Sequence, Blob
- Generalize Blob to support obtaining the length from an external layout element or function
- Review use of exceptions
- Support 64-bit integers
- BitField: support bool representation
- add constructor where layout decodes into object
- Float Problem HOT 1
- BitStructure: improve constructor argument processing
- test/LayoutTest: convert to strict mode
- struct: support variant decodings based on buffer length
- tagged unions should permit tag-only interpretations
- support utf-8 strings
- consider supporting variable-length blob
- C string inside fixed length array HOT 3
- Use Uint8Array instead of Buffer HOT 2
- Add typescript definitions HOT 5
- No browser test suite
- No examples for big-endian types
- Need layout of type Buffer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buffer-layout.