Artigo Acesso aberto Revisado por pares

Faster Base64 Encoding and Decoding Using AVX2 Instructions

2018; Association for Computing Machinery; Volume: 12; Issue: 3 Linguagem: Inglês

10.1145/3132709

ISSN

1559-114X

Autores

Wojciech Muła, Daniel Lemire,

Tópico(s)

Cellular Automata and Applications

Resumo

Web developers use base64 formats to include images, fonts, sounds, and other resources directly inside HTML, JavaScript, JSON, and XML files. We estimate that billions of base64 messages are decoded every day. We are motivated to improve the efficiency of base64 encoding and decoding. Compared to state-of-the-art implementations, we multiply the speeds of both the encoding (≈ 10 ×0) and the decoding (≈ 7 ×). We achieve these good results by using the single-instruction-multiple-data instructions available on recent Intel processors (AVX2). Our accelerated software abides by the specification and reports errors when encountering characters outside of the base64 set. It is available online as free software under a liberal license.

Referência(s)