allocateEncodeSize

Provide the size of the data once base64 encoded

When data is encoded in Base64, it is packed in groups of 3 bytes, which are then encoded in 4 bytes (by groups of 6 bytes). In case length is not a multiple of 3, we add padding. It means we need length / 3 * 4 + length % 3 ? 4 : 0.

  1. size_t allocateEncodeSize(ubyte[] data)
    size_t
    allocateEncodeSize
    (
    in ubyte[] data
    )
  2. size_t allocateEncodeSize(size_t length)

Parameters

data ubyte[]

An array that will be encoded

Return Value

Type: size_t

The size needed to encode data in base64

Meta