Snippets for Separate-AsciiBytes

This commit is contained in:
Pat Hartl 2023-01-28 16:44:15 -06:00
parent 3a65e2563b
commit 654943f4fd
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,2 @@
# Takes an input byte[] and separates it with 0x00 between each character
$bytes = Separate-AsciiBytes -Data $bytes

View file

@ -0,0 +1,12 @@
function Separate-AsciiBytes([byte[]]$Data)
{
$array = @()
foreach ($byte in $Data)
{
$array += $byte
$array += 0x00
}
return $array
}