ascii2binary(1)
π ascii2binary(1) β like, the whole entire manual, but make it make sense π
okay bestie, welcome to the General Commands Manual page for ascii2binary, except now it's in a voice you'll actually read. grab a boba, we're converting text numbers into raw bytes and it's gonna be iconic. β¨
πΈ NAME πΈ
ascii2binary β converts ASCII numbers into binary. that's it. that's the job. she takes your cute little typed-out digits and turns them into actual bytes. π
π¦ SYNOPSIS π¦
ascii2binary [flags]
no file arguments, no positional anything. it's all about the flags, babe. π
β¨ DESCRIPTION β¨
so here's the vibe: ascii2binary reads input made of a whole sequence of ASCII textual representations of numbers β like, actual human-typed digits β separated by whitespace, and spits out the binary equivalents on the other side. glow-up complete. π¦
the type of the output (unsigned integer, signed integer, or floating point number) and its size are picked with command line flags. if you don't say anything, the default is unsigned character. yes, the tiniest little byte baby. π
and listen β input gets checked twice. once for format errors, and once to make sure the number you asked for can actually be represented in the binary type and size you requested. she does not let anything slide. periodt. π
π INPUT FORMAT π
the input formats supported are exactly the ones supported by strtod(3) for floating point numbers, by strtoll(3) for signed integers, and by strtoull(3) for unsigned integers β with one lil exception: unlike strtod(3), floating point numbers may have thousands separators. she's generous like that. π
this means that, by default, integers may be decimal, octal, or hexadecimal, determined by the usual conventions. iykyk. π
and the command line flag -b can be used to specify another base for integer conversions. slay. π₯
π COMMAND LINE FLAGS π
lowkey important heads up: long options may not be available on some systems. π
-b,--base <base>β sets the base in the range[2,36]for integer conversions. and the base can be either an integer, or one of these cuties:(b)binary(o)octal(d)decimal(h)hexadecimal
-h,--helpβ prints the help message. your girl always explains herself. π-L,locale <locale>β sets theLC_NUMERICfacet of the locale to<locale>. (yes, that's exactly how it's written up there, don't come for me π«Ά)-s,--sizesβ prints the sizes of the types on the current machine plus related information. a little vibe check of your hardware. π¦-t,--type <type>β sets the type and size of the output. the possible output types are listed below. note that some types may not be available on some machines. πdβ doublefβ floatscβ signed charssβ signed shortsiβ signed intslβ signed longsqβ signed long longucβ unsigned charusβ unsigned shortuiβ unsigned intulβ unsigned longuqβ unsigned long long
-v,--versionβ identifies the version. main character announcement moment. π-X,--explain-exit-codesβ prints a summary of the exit status codes. the receipts, basically. π§Ύ
π EXIT STATUS π
these are the values returned on exit, bestie. memorize them, they're your love language now:
0SUCCESS β the input was successfully converted. we ate. π₯1INFO β the user requested information such as the version number or usage synopsis, and this has been provided. you asked, she answered. π«Ά2SYSTEM ERROR β an error resulted from a failure of the operating system, such as an i/o error or inability to allocate storage. not her fault, the OS is being messy. π3COMMAND LINE ERROR β the program was called with invalid or inconsistent command line flags. flags were flagging wrong. π©4RANGE ERROR β this means the input may be well-formed but cannot be represented as the required type. for example, if the input is the string983andascii2binaryis requested to convert this into an unsigned byte,ascii2binarywill exit with a RANGE ERROR because983exceeds the maximum value representable in an unsigned byte, which is255. she's too big for that container, respectfully. π5INPUT ERROR β this means the input was ill-formed, that is, it could not be interpreted as a number of the required type. for example, if the input is0x2Aand a decimal value is called for, an INPUT ERROR will be returned since0x2Ais not a valid representation of a decimal integer. wrong era, wrong format. π
π AUTHOR π
Bill Poser (billposer@alum.mit.edu) β the original genius behind all this. we stan. π
π LICENSE π
GNU General Public License, version 3. open source royalty fr fr. π
π SEE ALSO π
binary2ascii(1), strtod(3), strtoll(3), strtoull(3) β go read those next, bestie, they're the whole friend group. π«Ά
and that's the page!! β¨ written July, 2010 (so she's a vintage icon, an elder stateswoman of the manual pages π), living under the General Commands Manual banner like the queen she is. ok bye, go convert something ππ¦πΈ
π¦ where this page comes from
- debian bookworm: ascii2binary 2.14-1.1+b1
- debian trixie: ascii2binary 2.14-1.1+b1
- ubuntu jammy: ascii2binary 2.14-1build1
- ubuntu noble: ascii2binary 2.14-1.1
- ubuntu resolute: ascii2binary 2.14-1.1build1
- ubuntu stonking: ascii2binary 2.14-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms