Skip to content

Commit 66ca162

Browse files
authored
Correct imports in Shortcut Functions docs (#1349)
1 parent 83e92f2 commit 66ca162

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

site/docs/utilities/toBytes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ toBytes(
8787
Encodes a hex value to a byte array.
8888

8989
```ts
90-
import { numberToHex } from 'viem'
90+
import { hexToBytes } from 'viem'
9191

9292
hexToBytes('0x48656c6c6f20576f726c6421') // [!code focus:2]
9393
// Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])
@@ -103,7 +103,7 @@ hexToBytes('0x48656c6c6f20576f726c6421', { size: 32 }) // [!code focus:2]
103103
Encodes a string to a byte array.
104104

105105
```ts
106-
import { numberToHex } from 'viem'
106+
import { stringToBytes } from 'viem'
107107

108108
stringToBytes('Hello world') // [!code focus:2]
109109
// Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])
@@ -119,7 +119,7 @@ stringToBytes('Hello world', { size: 32 }) // [!code focus:2]
119119
Encodes a number to a byte array.
120120

121121
```ts
122-
import { numberToHex } from 'viem'
122+
import { numberToBytes } from 'viem'
123123

124124
numberToBytes(420) // [!code focus:2]
125125
// Uint8Array([1, 164])
@@ -135,7 +135,7 @@ numberToBytes(420, { size: 32 }) // [!code focus:2]
135135
Encodes a boolean to a byte array.
136136

137137
```ts
138-
import { boolToHex } from 'viem'
138+
import { boolToBytes } from 'viem'
139139

140140
boolToBytes(true) // [!code focus:2]
141141
// Uint8Array([1])

0 commit comments

Comments
 (0)