[[ REPOSTING due to minor mawk-1/nawk bug found ]]
@Digi : If you want a num-to-bin to handle it all, even when using gawk unicode mode, you can try this :
The exact code can print out any arbitrary 4-byte combination in mawk-1.3.4, mawk-1.9.9.6, gawk 5.1.1 byte mode, gawk 5.1.1 unicode mode, and macOS nawk.
It also has auto awk-variant detection in order to make necessary behavior adjustments, such as mawk-1 not printing large hex or negative hex, nawk not printing negative hex, mawk-2 not having auto-comma feature, and ensuring gawk-unicode-mode doesn't interpret the values as multi-byte unicode code points. (remove the leading dots - they're only for formatting purposes on newsgroup)
.. gawk -e '
....function encode(_,__,___) {
....return \
....sprintf("%c%c%c%c",(__<__)*((_%=___=(__^=__^=__+=__=__==__)\
........*__*__*__)+(_=int(_+___)%___))+int(_/=___/=__)%__+___,
.......................................... int(_*=__)%__+___,
..........................................int(_*=__)%__+___,
........................................int(_*__)%__+___)
.. } BEGIN {
........___=2^2^5; __["1701734259"]__["3891792015"]
........__["
2405365991"]__[sprintf("%.f",3^32-4^7)]
........__["-444025027"]=__["3850942269"]=-1
........PROCINFO["sorted_in"]="@val_num_asc"
........for(_ in __) {
............printf(" \t 32-bit usgned <( %"(\
..................("\333\222")~"[^\333\222]"?"":"\47"\
.................. )"22.f | 0x %16.8x )> = [[ %.4s\t]] \n",
.................._, +"0x1" ? ((_%___)+___)%___ : _, encode(_))
........}
....}'
........32-bit usgned <(.......... -444,025,027 | 0x ffffffffe588b73d )> = [[ 刷= ]]
........32-bit usgned <(..........3,850,942,269 | 0x........ e588b73d )> = [[ 刷= ]]
........32-bit usgned <(..........1,701,734,259 | 0x........ 656e6773 )> = [[ engs ]]
........32-bit usgned <(..1,853,020,188,835,457 | 0x....6954fe21dfe81 )> = [[ ??? ]]
........32-bit usgned <(..........2,405,365,991 | 0x........ 8f5ef8e7 )> = [[ ?^?? ]]
........32-bit usgned <(..........3,891,792,015 | 0x........ e7f8088f )> = [[ ?? ]]
% echo; mawk 'function encode(_,__,___) { return sprintf("%c%c%c%c",(__<__)*( (_%=___=(__^=__^=__+=__=__==__)*__*__*__)+(_=int(_+___)%___))+int(_/=___/=__)%__+___, int(_*=__)%__+___,int(_*=__)%__+___,int(_*__)%__+___) } BEGIN {___=2^2^5; __["1701734259"]__["3891792015"]__["
2405365991"]__[sprintf("%.f",3^32-4^7)];__["-444025027"]=__["3850942269"]=-1; PROCINFO["sorted_in"]="@val_num_asc"; for(_ in __) { printf(" \t 32-bit usgned <( %"(("\333\222")~"[^\333\222]"?"":"\47")"22.f | 0x %16.8x )> = [[ %.4s\t]] \n",_,+"0x1" ? ((_%___)+___)%___ : _, encode(_)) } }'
........32-bit usgned <(..........1,701,734,259 | 0x........ 656e6773 )> = [[ engs ]]
........32-bit usgned <(..1,853,020,188,835,457 | 0x........ e21dfe81 )> = [[ ??? ]]
........32-bit usgned <(..........2,405,365,991 | 0x........ 8f5ef8e7 )> = [[ ?^?? ]]
........32-bit usgned <(..........3,891,792,015 | 0x........ e7f8088f )> = [[ ?? ]]
........32-bit usgned <(..........3,850,942,269 | 0x........ e588b73d )> = [[ 刷= ]]
........32-bit usgned <(.......... -444,025,027 | 0x........ e588b73d )> = [[ 刷= ]]
% echo; mawk2 'function encode(_,__,___) { return sprintf("%c%c%c%c",(__<__)*( (_%=___=(__^=__^=__+=__=__==__)*__*__*__)+(_=int(_+___)%___))+int(_/=___/=__)%__+___, int(_*=__)%__+___,int(_*=__)%__+___,int(_*__)%__+___) } BEGIN {___=2^2^5; __["1701734259"]__["3891792015"]__["
2405365991"]__[sprintf("%.f",3^32-4^7)];__["-444025027"]=__["3850942269"]=-1; PROCINFO["sorted_in"]="@val_num_asc"; for(_ in __) { printf(" \t 32-bit usgned <( %"(("\333\222")~"[^\333\222]"?"":"\47")"22.f | 0x %16.8x )> = [[ %.4s\t]] \n",_,+"0x1" ? ((_%___)+___)%___ : _, encode(_)) } }'
........32-bit usgned <(............ 3891792015 | 0x........ e7f8088f )> = [[ ?? ]]
........32-bit usgned <(............ 3850942269 | 0x........ e588b73d )> = [[ 刷= ]]
........32-bit usgned <(............ 1701734259 | 0x........ 656e6773 )> = [[ engs ]]
........32-bit usgned <(...... 1853020188835457 | 0x....6954fe21dfe81 )> = [[ ??? ]]
........32-bit usgned <(............
2405365991 | 0x........ 8f5ef8e7 )> = [[ ?^?? ]]
........32-bit usgned <(............ -444025027 | 0x ffffffffe588b73d )> = [[ 刷= ]]
% echo; nawk 'function encode(_,__,___) { return sprintf("%c%c%c%c",(__<__)*( (_%=___=(__^=__^=__+=__=__==__)*__*__*__)+(_=int(_+___)%___))+int(_/=___/=__)%__+___, int(_*=__)%__+___,int(_*=__)%__+___,int(_*__)%__+___) } BEGIN {___=2^2^5; __["1701734259"]__["3891792015"]__["
2405365991"]__[sprintf("%.f",3^32-4^7)];__["-444025027"]=__["3850942269"]=-1; PROCINFO["sorted_in"]="@val_num_asc"; for(_ in __) { printf(" \t 32-bit usgned <( %"(("\333\222")~"[^\333\222]"?"":"\47")"22.f | 0x %16.8x )> = [[ %.4s\t]] \n",_,+"0x1" ? ((_%___)+___)%___ : _, encode(_)) } }'
........32-bit usgned <(..........3,850,942,269 | 0x........ e588b73d )> = [[ 刷= ]]
........32-bit usgned <(..........3,891,792,015 | 0x........ e7f8088f )> = [[ ?? ]]
........32-bit usgned <(..........1,701,734,259 | 0x........ 656e6773 )> = [[ engs ]]
........32-bit usgned <(.......... -444,025,027 | 0x........ e588b73d )> = [[ 刷= ]]
........32-bit usgned <(..........2,405,365,991 | 0x........ 8f5ef8e7 )> = [[ ?^?? ]]
........32-bit usgned <(..1,853,020,188,835,457 | 0x........ e21dfe81 )> = [[ ??? ]]
% echo; gawk -b -e 'function encode(_,__,___) { return sprintf("%c%c%c%c",(__<__)*( (_%=___=(__^=__^=__+=__=__==__)*__*__*__)+(_=int(_+___)%___))+int(_/=___/=__)%__+___, int(_*=__)%__+___,int(_*=__)%__+___,int(_*__)%__+___) } BEGIN {___=2^2^5; __["1701734259"]__["3891792015"]__["
2405365991"]__[sprintf("%.f",3^32-4^7)];__["-444025027"]=__["3850942269"]=-1; PROCINFO["sorted_in"]="@val_num_asc"; for(_ in __) { printf(" \t 32-bit usgned <( %"(("\333\222")~"[^\333\222]"?"":"\47")"22.f | 0x %16.8x )> = [[ %.4s\t]] \n",_,+"0x1" ? ((_%___)+___)%___ : _, encode(_)) } }'
........32-bit usgned <(.......... -444,025,027 | 0x ffffffffe588b73d )> = [[ 刷= ]]
........32-bit usgned <(..........3,850,942,269 | 0x........ e588b73d )> = [[ 刷= ]]
........32-bit usgned <(..........1,701,734,259 | 0x........ 656e6773 )> = [[ engs ]]
........32-bit usgned <(..1,853,020,188,835,457 | 0x....6954fe21dfe81 )> = [[ ??? ]]
........32-bit usgned <(..........2,405,365,991 | 0x........ 8f5ef8e7 )> = [[ ?^?? ]]
........32-bit usgned <(..........3,891,792,015 | 0x........ e7f8088f )> = [[ ?? ]]