Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using spaces when encoding without pretty print #31

Closed
alvarolb opened this issue Jan 18, 2015 · 3 comments
Closed

Avoid using spaces when encoding without pretty print #31

alvarolb opened this issue Jan 18, 2015 · 3 comments

Comments

@alvarolb
Copy link

When encoding the JSON string with the dump method, it will insert some spaces (after ":" or ",") even without pretty print active. It will add some undesired extra bytes when the data is just going over the wire. In my case it is important as I am encoding JSON Web Tokens (JWT), and every byte its important as the token is being transmitted in every request.

@nlohmann
Copy link
Owner

Good point! Those spaces should not be there. I'll fix it.

@mgerhardy
Copy link

@alvarolb are you using a library to generate the jwt stuff?

@alvarolb
Copy link
Author

hi @mgerhardy, no, I am not using any special Library... just my own code with some libraries for the crypto part.

GerHobbelt pushed a commit to GerHobbelt/nlohmann-json that referenced this issue May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants