Another syntax method would be to use switch letters similar to the way $encode does it, using the same switch letters plus another for hex:

Quote:

o0 -> t = text
o1 -> h = hex base16 (default)
o2 -> m = mime
o3 -> u = uuencode
o4 -> a = base32
b = encoded string is instead sent to parameter &binvar, and normal output is instead the number of bytes put into &binvar


(and possibly another switch letter for Base85)
https://forums.mirc.com/ubbthreads.php/topics/263013

I'm assuming it's easier for an identifier to have the switches be a separate parameter rather than joining with the current digits 0/1/2.

Quote:

var %a $sha1($mircini,2,m) = hash of mirc.ini to %a encoded as mime (mime of the 20 binary bytes of the binary hash output, not mime of the 40 hex text characters)
var %a $sha1(abc,,m) = mime string to %a ($null 2nd parm handled as default 0)
var %a $sha1(dspx,,tb,&binvar) = 20 binary bytes to &binvar including 0x00's, %a contains $bvar(&binvar,0)
var %a $sha1(dspx,,t) = %a contains text string chopped at the first encountered 0x00 if any