I have a byte array similar to this (16 bytes):
71 77 65 72 74 79 00 00 00 00 00 00 00 00 00 00
I use this to convert it to a string and tr
In powershell, you can do this:
$yourString.TrimEnd(0x00)