in ,

Base64 encoding and decoding at almost the speed of a memory copy, Hacker News


  

              

                                   (Submitted on 2 Oct 2019)     

Abstract:Many common document formats on the Internet are text-only such as email (MIME) and the Web (HTML, JavaScript, JSON and XML). To include images or executable code in these documents, we first encode them as text using base 64. Standard base 64 encoding uses 64 ~ ASCII characters: both lower and upper case Latin letters, digits and two other symbols. We show how we can encode and decode base 64 data at nearly the speed of a memory copy (memcpy) on recent Intel processors, as long as the data does not fit in the first-level (L1) cache. We use the SIMD (Single Instruction Multiple Data) instruction set AVX – 512 available on commodity processors. Our implementation generates several times fewer instructions than previous SIMD-accelerated base 64 codecs. It is also more versatile, as it can be adapted — even at runtime — to any base 64 variant by only changing constants.

            

      

Submission history

From: Daniel Lemire [view email]       
[v1]Wed, 2 Oct 2019 15: 39: (UTC) (KB)

Brave Browser
Read More
Payeer

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

LRB · Misha Glenny and Callum Lang · How to Buy Drugs, Hacker News

LRB · Misha Glenny and Callum Lang · How to Buy Drugs, Hacker News

Rakesh Jhunjhunwala's top pick tumbles nearly 10% post Q2 results; what should investors do? – Moneycontrol.com, Moneycontrol.com

Rakesh Jhunjhunwala's top pick tumbles nearly 10% post Q2 results; what should investors do? – Moneycontrol.com, Moneycontrol.com