by nicoburns · 3y ago · 0 comments
0x[de ad be ef 00]
So much nicer than the usual condensed format. And I think it'd be valid syntax in any language that allows binary integer literal.[1] https://elixir-lang.org/getting-started/binaries-strings-and...
They do e.g. Python
>>> 0x_ab_cd_01_23
2882339107
or >>> 0b_0010_0100
36Here's how we ended up supporting byte strings (# prefix) in Ecstasy, in this case multi-line:
Byte[] bytes = #|12 34 56
|78 9a BC
|dE f0
;
console.println($|bytes=
|{bytes.toHexDump(4)}
);
Which prints: bytes=
00: 12 34 56 78 .4Vx
04: 9A BC DE F0 .¼Þð 0xde_ad_be_ef_00(Given they have been listed separately rather than as a single number).