GOLF(2gg)
π
GOLF(2gg) β the decode-hex page, bestie edition π
okay so we're in the 2gg manual, and today's main character is decode-hex. it's giving hex-decoding. it's giving glow-up from ugly hex string to actual binary. let's go π¦
β¨ NAME β¨
decode-hex β the hex-decoding one (hex-encoding, but make it reverse) π
π― PURPOSE π―
take a hexadecimal string and turn it into data. that's it. that's the whole job. no cap. β¨
π SYNTAX π
decode-hex <data> to <output> \
[ input-length <input length> ]
π DESCRIPTION π
so here's the tea, bestie: decode-hex decodes a hexadecimal string β that's <data> β into the string <output>, which you hand over in the to clause. lowkey iconic behaviour. π«Ά
now, the rules for <data>, and listen up because this is the part people mess up:
- <data> must be an even number of digits
0-9and lettersA-Fora-f. like, even. an EVEN number. if you roll up with an odd count it's not gonna slay. π - the length of <data> can be given by the <input length> number in the
input-lengthclause. you don't have to pass it though β if you don't, the length is assumed to be the string length of <data>. periodt. π
πΈ EXAMPLES πΈ
say you wanna get the original binary data back from a hexadecimal string called "hexdata". the output string "binout" gets created. watch this:
set-string hexdata = "0041000F414200"
decode-hex hexdata to binout
and the value of "binout"? it'll be binary data equal to this C literal right here:
"\x00""A""\x00""\xF""AB""\x00""\x04"
literally so satisfying when it works out like that ππ
π SEE ALSO π
- Hex encoding π§
decode-hexencode-hex- See all documentation π
that's the whole page, babe. $DATE, version $VERSION β stay hexed, stay hydrated, and go decode something gorgeous. mwah ππ
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms