Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function Convert-ByteArrayToHex {
- [cmdletbinding()]
- param(
- [parameter(Mandatory=$true)]
- [Byte[]]
- $Bytes
- )
- $HexString = [System.Text.StringBuilder]::new($Bytes.Length * 2)
- ForEach($byte in $Bytes){
- $HexString.AppendFormat("{0:x2}", $byte) | Out-Null
- }
- $HexString.ToString()
- }
Advertisement
Add Comment
Please, Sign In to add comment