> For the complete documentation index, see [llms.txt](https://elacity.gitbook.io/elacity-sdks/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://elacity.gitbook.io/elacity-sdks/protocol/v3.0/references/library/bytesmask.md).

# BytesMask

[Git Source](https://github.com/Elacity/v3-drm-protocol/blob/52ca0e7824ef5fab5ebe0a131f7c6e6dd330de09/contracts/library/BytesMask.sol)

**Title:** BytesMask

Produces fixed-width masks used to partition token-id ranges by plan id.

## Functions

### maskU16

Builds a `bytes16` mask containing a sentinel byte and the provided id.

```solidity
function maskU16(uint8 id) internal pure returns (bytes16 r);
```

**Parameters**

| Name | Type    | Description                                               |
| ---- | ------- | --------------------------------------------------------- |
| `id` | `uint8` | Identifier inserted into the mask. Must be in `[1, 255]`. |

**Returns**

| Name | Type      | Description           |
| ---- | --------- | --------------------- |
| `r`  | `bytes16` | Generated mask value. |
