LibBytes

Git Source

This library helps manipulating bytes.

Functions

slice

Slices the provided bytes.

function slice(bytes memory bytes_, uint256 start, uint256 length) internal pure returns (bytes memory);

Parameters

NameTypeDescription
bytes_bytesBytes to slice
startuint256The starting index of the slice
lengthuint256The length of the slice

Returns

NameTypeDescription
<none>bytesThe slice of _bytes starting at _start of length _length

Errors

SliceOverflow

The length overflows an uint.

error SliceOverflow();

SliceOutOfBounds

The slice is outside of the initial bytes bounds.

error SliceOutOfBounds();