Book Image

JavaScript JSON Cookbook

By : Ray Rischpater, Brian Ritchie, Ray Rischpater
Book Image

JavaScript JSON Cookbook

By: Ray Rischpater, Brian Ritchie, Ray Rischpater

Overview of this book

Table of Contents (17 chapters)
JavaScript JSON Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 8. Using JSON for Binary Data Transfer

In this chapter, we will discuss the intersection between JSON and binary data. Here, you'll find the following recipes:

  • Encoding binary data as a base64 string using Node.js

  • Decoding binary data from a base64 string using Node.js

  • Encoding and decoding binary data as a base64 string using JavaScript in the browser

  • Encoding data as BSON using Json.NET

  • Decoding data from BSON using Json.NET

  • Using DataView to access ArrayBuffer

  • Encoding and decoding base64 using an ArrayBuffer

  • Compressing object-body content from a Node.js server built using the express module