alexei/sprintf.js

hx specifier doesn't work

kurdibogdan opened this issue · 3 comments

%hx specifier is for short hexadecimal numbers (typically 2 bytes). For example:
sprintf("%hX\n", 65536); // = hexa 0
sprintf("%X\n", 65536); // = hexa 10000

The javascript version of sprintf throws error:
SyntaxError: [sprintf] unexpected placeholder

What's a "short hexadecimal number" in JavaScript?

I mean, a short integer (typically 2 bytes) represented in hexadecimal form (largest number = 0xFFFF).

JS has ints and that's it