## Index

### Functions

- decode
- encode

### Object literals

- Tag

## Functions

### decode

- decode(data: any): __type

- - Defined in lib/util/tlv.ts:79

  #### Parameters

  - ##### data: any

  #### Returns __type

### encode

- encode(type: any, data: any, ...args: any[]): Buffer

- - Defined in lib/util/tlv.ts:34

  #### Parameters

  - ##### type: any

  - ##### data: any

  - ##### Rest ...args: any[]

  #### Returns Buffer

## Object literals

### Const Tag

Tag: object

- Defined in lib/util/tlv.ts:16

Type Length Value encoding/decoding, used by HAP as a wire format. https://en.wikipedia.org/wiki/Type-length-value

Originally based on code from github:KhaosT/HAP-NodeJS@0c8fd88 used used per the terms of the Apache Software License v2.

Original code copyright Khaos Tian khaos.tian@gmail.com

Modifications copyright Zach Bean zb@forty2.com

- Reformatted for ES6-style module
- Rewrote encode() to be non-recursive; also simplified the logic
- Rewrote decode()

### BackOff

BackOff: number = 8

- Defined in lib/util/tlv.ts:27

### EncryptedData

EncryptedData: number = 5

- Defined in lib/util/tlv.ts:24

### ErrorCode

ErrorCode: number = 7

- Defined in lib/util/tlv.ts:26

### MFiCertificate

MFiCertificate: number = 9

- Defined in lib/util/tlv.ts:30

### MFiSignature

MFiSignature: number = 10

- Defined in lib/util/tlv.ts:31

### PairingMethod

PairingMethod: number = 0

- Defined in lib/util/tlv.ts:17

### Proof

Proof: number = 4

- Defined in lib/util/tlv.ts:23

### PublicKey

PublicKey: number = 3

- Defined in lib/util/tlv.ts:22

### Salt

Salt: number = 2

- Defined in lib/util/tlv.ts:19

### Sequence

Sequence: number = 6

- Defined in lib/util/tlv.ts:25

### Signature

Signature: number = 10

- Defined in lib/util/tlv.ts:28

### Username

Username: number = 1

- Defined in lib/util/tlv.ts:18

Generated using TypeDoc