Comments (6)
@cavenaghi9 @beclever @illumi I have pushed an update that keeps the order of map entries if the non-canonical mode is active (see README). Publishing to maven central follows.
from cbor-java.
Map internally uses a HashMap. If you come up with a PR that changes the current HashMap implementation to a TreeMap one, I will merge it.
from cbor-java.
I found that it was not the https://github.com/c-rack/cbor-java/blob/master/src/main/java/co/nstant/in/cbor/model/Map.java but the sortedMap of TreeMap
type in https://github.com/c-rack/cbor-java/blob/master/src/main/java/co/nstant/in/cbor/encoder/MapEncoder.java caused the problem. In the case, -2 encode as 33, 0 encode as 0, so key 0 will on first item. I don't know why it should bee sortedMap here?
from cbor-java.
The TreeMap is used because the CBOR specification has a section about a canonical format:
https://tools.ietf.org/html/rfc7049#section-3.9
One could consider to introduce a non-canoncial mode, which does not use a TreeMap. Any PRs in that direction are welcome.
from cbor-java.
I'm also interested in map insertion order. How would you prefer to configure such a mode?
from cbor-java.
@c-rack when the version 0.9 of the library will be available on maven central repository?
from cbor-java.
Related Issues (20)
- Tag for v0.9 HOT 2
- Published JavaDoc is outdated or incomplete
- The CBOR library is sensitive to a DOS attack HOT 2
- Fuzzing cbor-java by way of OSS-Fuzz HOT 6
- Creating a finite/fixed-size map HOT 2
- Could decoding be more ergonomic? HOT 1
- Define `Automatic-Module-Name` in manifest HOT 1
- How to performimg cbor Byte(*) ? HOT 3
- Deleted
- Release new version HOT 6
- Issue while encoding Json string HOT 1
- Difficult to decode byte array e.g. byte[] HOT 2
- Documentation for cbor-java library HOT 2
- Compatibility with peteroupc library(https://github.com/peteroupc/CBOR-Java) HOT 1
- Escaping of special characters while serialization and de-serialization HOT 3
- How to decode HOT 3
- Infinite loop during decode HOT 5
- serialize and deserialize HOT 1
- Release 0.9 HOT 7
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 cbor-java.