Calculate the size to a Base64 encoded message

前端 未结 9 821
暗喜
暗喜 2020-12-15 04:17

I have a binary string that I am encoding in Base 64. Now, I need to know before hand the size of the final Base 64 encoded string will be.

Is there any way to calcu

9条回答
  •  长情又很酷
    2020-12-15 04:47

    Base 64 transforms 3 bytes into 4.

    If you're set of bits does not happen to be a multiple of 24 bits, you must pad it out so that it has a multiple of 24 bits (3 bytes).

提交回复
热议问题