# encoding: ascii
# api: powershell
# title: Convert-ToCHexString
# description: 01 00 00 00 d0 8c 9d df 01 15 d1 11 8c 7a 00 c0 4f c2 97 eb 01 
# version: 0.1
# type: function
# author: CrazyDave
# license: CC0
# function: Convert-ToCHexString
# x-poshcode-id: 5821
# x-derived-from-id: 5920
# x-archived: 2017-04-10T08:03:23
# x-published: 2017-04-09T21:41:00
#
# 00 00 00 bd 4f 5b be 99 cb f5 45 94 62 5f 89 6d d3 a6 b9 00 00 00 00 02 00 
# 00 00 00 00 10 66 00 00 00 01 00 00 20 00 00 00 e3 4b 79 19 78 60 e0 ec 12 
# d4 75 d3 ee 3f cb 7b 73 56 90 a0 1f 73 59 49 25 02 67 37 f4 5a 2e 5a 00 00 
# 00 00 0e 80 00 00 00 02 00 00 20 00 00 00 cc 5e e8 7f 1a c8 f2 47 bd 16 1a 
# b9 19 98 1f c3 a5 01 bc b7 5c a7 e7 d8 4e f8 21 4a ec c7 5c 28 10 00 00 00 
# 76 ef 43 5e 5e 9a 1a 53 73 79 7a fe 1b 5c 6d be 40 00 00 00 e3 38 bc a6 8a 
# 3e 18 e5 d0 b5 80 fa c2 dd c9 3d 04 81 bf 36 c4 e0 5a 35 69 42 f5 60 0f 2d 
# 94 42 77 8f 2a 04 f4 6b f5 80 d8 1f 9e 14 1a 2b c1 a7 37 be 94 b0 13 48 72 
# 9d f0 58 58 48 7f ab 49 b3
#
function Convert-ToCHexString 
{
	param ([String] $str) 
	$ans = ''
	[System.Text.Encoding]::ASCII.GetBytes($str) | % { $ans += "0x{0:X2}, " -f $_ }
	return $ans.Trim(' ',',')
}
