> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Byte

> Represents a byte. A byte can only contain integer values between 0 and 255. Large values will be masked.

Represents a byte. A byte can only contain integer values between 0 and 255. Large values will be masked.

## Constructors

### Byte()

```crmscript theme={null}
Byte Byte()
```

Default constructor.

### Byte(Integer)

```crmscript theme={null}
Byte Byte(Integer value)
```

Pass a number to copy into a new object.

## Methods

## toHex()

Convert the value of the current byte to a hexadecimal representation of the byte. For example, 10 will return "a", 11 will return "b", and so on.

```crmscript theme={null}
String toHex()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Hexadecimal representation of the byte.

<Note>
  Use toHex(Integer) to provide the number of padding zeros.
</Note>

## toHex(Integer)

Convert the value of the current byte to a hexadecimal representation of the byte with padding zeros. For example, 10 will return "a", 11 will return "b", and so on.

```crmscript theme={null}
String toHex(Integer padding)
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Hexadecimal representation of the byte with padding zeros.

## toString()

Converts a byte value to its string representation.

```crmscript theme={null}
String toString()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String)

## toInteger()

Converts a byte value to its integer representation (0 - 255).

```crmscript theme={null}
Integer toInteger()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Integer representation (0 - 255)

## toBool()

Returns the boolean value of the Byte.

```crmscript theme={null}
Bool toBool()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool)

**Example:**

```crmscript theme={null}
If(value != 0)
\treturn true;
else
\treturn false;
```


## Related topics

- [String](/en/automation/crmscript/reference/CRMScript.Global.String.md)
- [Pbes](/en/automation/crmscript/reference/CRMScript.Native.Pbes.md)
- [Rsa](/en/automation/crmscript/reference/CRMScript.Native.Rsa.md)
- [String data type](/en/automation/crmscript/datatypes/string-type.md)
- [Void](/en/automation/crmscript/reference/CRMScript.Global.Void.md)
- [Namespace CRMScript.Global](/en/automation/crmscript/reference/CRMScript.Global.md)
