---
name: "hexStringToNumber"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.0.0" }
title: "string"
---

## hexStringToNumber

> [VERSION] @ray-js/panel-sdk >= 1.0.0

> 💡 Equivalent to the original hexToBytes; groups every two hex characters and converts them to decimal numbers.

### Description

Convert a hex string to an array of numbers

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `bits` | `string` | Yes | Hex string, e.g., 'AD03' |

### Return Value

Type: `number[]`

Array of numbers parsed from each pair of hex characters

### Examples

#### Basic usage

```ts
import { utils } from '@ray-js/panel-sdk';

const { hexStringToNumber } = utils;

hexStringToNumber('AD03'); // [173, 3]
hexStringToNumber('FF00'); // [255, 0]
```

---
name: "hexStringToBinString"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.0.0" }
title: "string"
---
## hexStringToBinString

> [VERSION] @ray-js/panel-sdk >= 1.0.0

### Description

Convert a hex string to a binary string

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `hexString` | `string` | Yes | Hex string, e.g., 'A7B9' |

### Return Value

None


### Examples

#### Basic usage

```ts
import { utils } from '@ray-js/panel-sdk';

const { hexStringToBinString } = utils;

hexStringToBinString('A7B9'); // '1010011110111001'
hexStringToBinString('0709'); // '0000011100001001'
```

---
name: "camelize"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.0.0" }
title: "string"
---
## camelize

> [VERSION] @ray-js/panel-sdk >= 1.0.0

> 💡 If a number is passed, it is returned as a string.

### Description

Convert a string to camelCase

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `str` | `string` | Yes | The string to convert; supports hyphen, underscore, or space separators |

### Return Value

None


### Examples

#### Basic usage

```ts
import { utils } from '@ray-js/panel-sdk';

const { camelize } = utils;

camelize('background-color'); // 'backgroundColor'
camelize('font_size');        // 'fontSize'
camelize('hello world');      // 'helloWorld'
```

---
name: "strToHexString"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.0.0" }
title: "string"
---
## strToHexString

> [VERSION] @ray-js/panel-sdk >= 1.0.0

> 💡 This function extracts all consecutive 4-bit binary substrings (composed only of 0 and 1) from the input string, then converts each group to a single hex character.

### Description

Extract binary fragments from a string and convert them to a hex string

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `str` | `string` | Yes | A string containing '0' and '1' characters; may include other characters |

### Return Value

None


### Examples

#### Basic usage

```ts
import { utils } from '@ray-js/panel-sdk';

const { strToHexString } = utils;

strToHexString('ababba0102hghg0011100'); // '3'
strToHexString('ababba0102hghg001110011000111'); // '398'
```
