Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function Convert-HexToByteArray {
- [cmdletbinding()]
- param(
- [parameter(Mandatory=$true)]
- [String]
- $HexString
- )
- $Bytes = [byte[]]::new($HexString.Length / 2)
- For($i=0; $i -lt $HexString.Length; $i+=2){
- $Bytes[$i/2] = [convert]::ToByte($HexString.Substring($i, 2), 16)
- }
- $Bytes
- }
Advertisement
Add Comment
Please, Sign In to add comment