Skip to content

Commit

Permalink
Add note to valueToBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Oct 5, 2022
1 parent f7688fb commit d77e1c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bytes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ export function stringToBytes(value: string): Uint8Array {
* Convert a byte-like value to a `Uint8Array`. The value can be a `Uint8Array`,
* a `bigint`, a `number`, or a `string`.
*
* This will attempt to guess the type of the value based on its type and
* contents. For more control over the conversion, use the more specific
* conversion functions, such as {@link hexToBytes} or {@link stringToBytes}.
*
* If the value is a `string`, and it is prefixed with `0x`, it will be
* interpreted as a hexadecimal string. Otherwise, it will be interpreted as a
* UTF-8 string. To convert a hexadecimal string to bytes without interpreting
Expand Down

0 comments on commit d77e1c5

Please sign in to comment.