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)
  2. size_t allocateEncodeSize(size_t length)
    size_t
    allocateEncodeSize
    (
    size_t length
    )

Parameters

length size_t

Number of bytes to be encoded

Return Value

Type: size_t

The size needed to encode a data of the provided length

Meta