Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fathym_common/src/common/iterables/concatUint8Arrays.ts>concatUint8Arrays

The Fathym Reference Architecture provides the common foundation for applications built in Typescript.
Latest
function concatUint8Arrays
import { concatUint8Arrays } from "https://deno.land/x/fathym_common@v0.2.167/src/common/iterables/concatUint8Arrays.ts";

Concatenate two Uint8Array objects into a new Uint8Array object.

Examples

From direct import

import { Uint8Array } from '@fathym/common/iterables';

const a = new Uint8Array([1, 2, 3]);
const b = new Uint8Array([4, 5, 6]);

const concatenated = concatUint8Arrays(a, b);

console.log(concatenated); // [1, 2, 3, 4, 5, 6]

From common import

import { Uint8Array } from '@fathym/common';

const a = new Uint8Array([1, 2, 3]);
const b = new Uint8Array([4, 5, 6]);

const concatenated = concatUint8Arrays(b, a);

console.log(concatenated); // [4, 5, 6, 1, 2, 3]

Parameters

a: Uint8Array

The first Uint8Array to concatenate before the second.

b: Uint8Array

The second Uint8Array to concatenate to the end of the first.

Returns

Uint8Array

The concatenated Uint8Array value.