# Class: Serializers

## Serializers

#### new Serializers

  Serializers for various types

  Source:
    - serializers.js, line 7

### Methods

#### <static> encodeAscii

  Encodes for Ascii

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `val` | String | The ascii string value to serialize

  Source:
    - serializers.js, line 93

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer

#### <static> encodeBinary

  Does binary encoding

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `val` | String | The binary string to serialize

  Source:
    - serializers.js, line 41

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer

#### <static> encodeBoolean

  Encodes a boolean type

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `val` | Boolean | true or false, will be serialized into the proper boolean value

  Source:
    - serializers.js, line 135

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer

#### <static> encodeDate

  Encodes a Date object

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `val` | Date | The date to serialize

  Source:
    - serializers.js, line 149

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer

#### <static> encodeDouble

  Encode a Double Precision Floating Point Type

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `val` | Number | The number to serialize into a Double Precision Floating Point

  Source:
    - serializers.js, line 111

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer

#### <static> encodeFloat

  Encode a Double Precision Floating Point Type

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `val` | Number | The number to serialize into a Single Precision Floating Point

  Source:
    - serializers.js, line 123

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer

#### <static> encodeInt32

  Encodes a 32bit Unsinged Integer

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `val` | Number | The number to serialize into a 32-bit integer

  Source:
    - serializers.js, line 65

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer

#### <static> encodeInteger

  Encodes an N length Integer

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `bits` | Number | The number of bits to encode to
  `num` | Number | The number to encode

  Source:
    - serializers.js, line 16

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer

#### <static> encodeLong

  Encodes a Long (UInt64)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `val` | Number | The number to serialize into a long

  Source:
    - serializers.js, line 55

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer

#### <static> encodeTimeUUID

  Encodes a TimeUUID Object

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `val` | TimeUUID | The uuid object to serialize

  Source:
    - serializers.js, line 177

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer

#### <static> encodeUTF8

  Encodes for UTF8

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `val` | String | The utf8 string value to serialize

  Source:
    - serializers.js, line 75

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer

#### <static> encodeUUID

  Encodes a UUID Object

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `val` | UUID | The uuid object to serialize

  Source:
    - serializers.js, line 167

  ##### Returns:

  A buffer containing the value bytes
  Type
    Buffer