O'Reilly logo

HTML5 Data and Services Cookbook by Mite Mitreski, Gorgi Kosev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Decoding base64 encoded binary data

Until very recently, JavaScript didn't have any native support for storing binary data types. Most binary data was handled as strings. Binary data that could not be handled using strings (for example, images) was handled as base64 encoded strings.

Note

Base64 is a method to encode binary data by converting groups of bytes into groups of base64 numbers. The goal is to avoid data loss by safely representing binary data using only printable characters which will not be interpreted in a special way.

HTML5 has much better support for binary data, it can be stored and manipulated using the ArrayBuffer class and the typed array classes. However, legacy libraries and API may still use base64 data. In order to do more efficient ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required