# Class: PaddingPacket

## PaddingPacket()

Implementation of the Padding Packet

https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh#name-padding-packet-tag-21: Padding Packet

## Constructor

#### new PaddingPacket()

Source:
  - packet/padding.js, line 27

### Methods

#### (async) createPadding(length)

Create random padding.

##### Parameters:

Name | Type | Description
--- | --- | ---
`length` | Number | The length of padding to be generated.

Source:
  - packet/padding.js, line 58

##### Throws:

if padding generation was not successful

Type
  Error

#### read(bytes)

Read a padding packet

##### Parameters:

Name | Type | Description
--- | --- | ---
`bytes` | Uint8Array | ReadableStream.<Uint8Array> |

Source:
  - packet/padding.js, line 40

#### write() → {Uint8Array}

Write the padding packet

Source:
  - packet/padding.js, line 48

##### Returns:

The padding packet.

Type
  Uint8Array