[skip ci] consistent formatting

This commit is contained in:
Zahary Karadjov 2022-06-17 11:39:35 +03:00
parent 9fe9cb7002
commit f75c0a273a
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 5 additions and 5 deletions

View File

@ -88,30 +88,30 @@ func hexToByteArrayStrict*(hexStr: openArray[char], output: var openArray[byte],
raise (ref ValueError)(msg: "hex string too long")
func hexToByteArrayStrict*(hexStr: openArray[char], output: var openArray[byte])
{.raises: [ValueError, Defect], inline.} =
{.raises: [ValueError, Defect], inline.} =
## Read a hex string and store it in a byte array `output`. No "endianness" reordering is done.
## The entire input must be consumed.
hexToByteArrayStrict(hexStr, output, 0, output.high)
func hexToByteArrayStrict*[N: static[int]](hexStr: openArray[char]): array[N, byte]
{.raises: [ValueError, Defect], noinit, inline.}=
{.raises: [ValueError, Defect], noinit, inline.}=
## Read an hex string and store it in a byte array. No "endianness" reordering is done.
## The entire input must be consumed.
hexToByteArrayStrict(hexStr, result)
func hexToByteArrayStrict*(hexStr: openArray[char], N: static int): array[N, byte]
{.raises: [ValueError, Defect], noinit, inline.}=
{.raises: [ValueError, Defect], noinit, inline.}=
## Read an hex string and store it in a byte array. No "endianness" reordering is done.
## The entire input must be consumed.
hexToByteArrayStrict(hexStr, result)
func fromHex*[N](A: type array[N, byte], hexStr: string): A
{.raises: [ValueError, Defect], noinit, inline.}=
{.raises: [ValueError, Defect], noinit, inline.}=
## Read an hex string and store it in a byte array. No "endianness" reordering is done.
hexToByteArray(hexStr, result)
func hexToPaddedByteArray*[N: static[int]](hexStr: string): array[N, byte]
{.raises: [ValueError, Defect].} =
{.raises: [ValueError, Defect].} =
## Read a hex string and store it in a byte array `output`.
## The string may be shorter than the byte array.
## No "endianness" reordering is done.