Snippets for Separate-AsciiBytes
This commit is contained in:
parent
3a65e2563b
commit
654943f4fd
2 changed files with 14 additions and 0 deletions
2
LANCommander/Snippets/Examples/Separate ASCII Bytes.ps1
Normal file
2
LANCommander/Snippets/Examples/Separate ASCII Bytes.ps1
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Takes an input byte[] and separates it with 0x00 between each character
|
||||||
|
$bytes = Separate-AsciiBytes -Data $bytes
|
12
LANCommander/Snippets/Functions/Separate-AsciiBytes.ps1
Normal file
12
LANCommander/Snippets/Functions/Separate-AsciiBytes.ps1
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
function Separate-AsciiBytes([byte[]]$Data)
|
||||||
|
{
|
||||||
|
$array = @()
|
||||||
|
|
||||||
|
foreach ($byte in $Data)
|
||||||
|
{
|
||||||
|
$array += $byte
|
||||||
|
$array += 0x00
|
||||||
|
}
|
||||||
|
|
||||||
|
return $array
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue