The documentation is currently being reviewed, so you may see some inconsistencies between sections.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Concat

Purpose

Sometimes it is necessary to concatenate data together to form an input or output. This is represented via the || symbol in pseudocode.

For example, an AEAD ciphertext is usually a ciphertext concatenated with a tag.

Usage

Concat

Fills a span with the concatenation of two spans.

Spans.Concat(Span<byte> buffer, ReadOnlySpan<byte> a, ReadOnlySpan<byte> b)

Exceptions

ArgumentOutOfRangeException

buffer has a length not equal to a.Length + b.Length.

OverflowException

a.Length + b.Length has resulted in an overflow.

Concat

Fills a span with the concatenation of three spans.

Exceptions

ArgumentOutOfRangeException

buffer has a length not equal to a.Length + b.Length + c.Length.

OverflowException

a.Length + b.Length + c.Length has resulted in an overflow.

Concat

Fills a span with the concatenation of four spans.

Exceptions

ArgumentOutOfRangeException

buffer has a length not equal to a.Length + b.Length + c.Length + d.Length.

OverflowException

a.Length + b.Length + c.Length + d.Length has resulted in an overflow.

Concat

Fills a span with the concatenation of five spans.

Exceptions

ArgumentOutOfRangeException

buffer has a length not equal to a.Length + b.Length + c.Length + d.Length + e.Length.

OverflowException

a.Length + b.Length + c.Length + d.Length + e.Length has resulted in an overflow.

Concat

Fills a span with the concatenation of six spans.

Exceptions

ArgumentOutOfRangeException

buffer has a length not equal to a.Length + b.Length + c.Length + d.Length + e.Length + f.Length.

OverflowException

a.Length + b.Length + c.Length + d.Length + e.Length + f.Length has resulted in an overflow.

Notes

There is unfortunately no Concat() function for arrays or spans in .NET, and there is not even a Span<T>.CopyTo(Span<T> destination, int index). This class fills that gap.

Last updated