[#BloombergLP-bdlbb-BlobUtil-padToAlignment]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlbb.adoc[bdlbb]::xref:BloombergLP/bdlbb/BlobUtil.adoc[BlobUtil]::padToAlignment
:relfileprefix: ../../../
:mrdocs:

Pad a blob so its length is a multiple of the given alignment&period;

== Synopsis

Declared in `&lt;bdlbb&lowbar;blobutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
padToAlignment(
    xref:BloombergLP/bdlbb/Blob.adoc[Blob]* dest,
    int alignment,
    char fillChar = &apos;&bsol;0&apos;);
----

== Description

Append padding bytes to the specified `dest` so that its resulting length is an integer multiple of the specified `alignment`&period; Optionally specify `fillChar` with which the padding is to be filled&period; If `fillChar` is not specified, a 0 byte will be used&period; The behavior is undefined unless `alignment` is a power of 2, and less than or equal to 64&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dest*
| blob to pad
| *alignment*
| power&hyphen;of&hyphen;two alignment for the resulting length
| *fillChar*
| byte value used for padding
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
