[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Buffer](https://evolu.dev/docs/api-reference/common/Buffer) › bytesToHex

```ts
function bytesToHex(bytes: TArg<Uint8Array<ArrayBufferLike>>): string;
```

Defined in: node\_modules/@noble/ciphers/utils.d.ts:292

Convert byte array to hex string. Uses built-in function, when available.

## Throws

On wrong argument types. [TypeError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError)

## Example

Formats ciphertext bytes for logs or test vectors.

```ts
bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'
```