Projects / Ascii2Binary

Ascii2Binary

The Ascii2Binary project consists of two complementary programs that convert between textual and binary representations of numbers. Ascii2Binary reads input consisting of textual representations of numbers separated by whitespace and produces as output the binary equivalents. It is useful for generating test data and linking programs that generate textual output to programs that require binary input. Binary2Ascii converts binary numbers to text. In both programs, the type and size/precision of the input or output is selected using command line flags.

Tags
Operating Systems
Implementation
Translations

RSS Recent releases

  •  30 Aug 2010 09:48

Release Notes: endian.h was renamed to avoid conflict with the external endian.h. Minor changes were made in the man pages.

  •  13 Feb 2007 01:00

Release Notes: The information provided by the -s flag about the machine has been reformatted and now includes the extreme values for each type. Information about wchar_t has been added.

  •  19 Dec 2006 03:21

Release Notes: The -s flag, which reports the numeric types available and their sizes, is now auto-configured so that types such as long double that are not available on all systems will be reported if they are.

  •  19 Apr 2006 14:38

Release Notes: ascii2binary can now handle numbers with thousands separators. A new command line flag has been added that sets the locale for the LC_NUMERIC facet. In the case of ascii2binary, this determines what character will be interpreted as the thousands separator. In the case of binary2ascii, this controls thousands separation and decimal point. Among other things, this means that a pipeline of ascii2binary followed by binary2ascii can be used to convert numeric strings from one locale's format to that of another. Flags have been added for suppressing thousands separation and zero-padding.

  •  11 Mar 2006 22:48

Release Notes: The -l option was added to add a linefeed after every 0x0A where the size is char, byte, short, or int; that is, the sizes where 0x0A might represent a character. Long options are now provided if getopt_long is available.

RSS Recent comments

18 Jan 2014 15:23 fgnievinski Thumbs up

please note: although it'll compile in mingw for windows, results are unreliable, e.g.:

$ echo "1" | ascii2binary | binary2ascii
'3hhu

(expected output: 1)

18 Jan 2014 13:39 fgnievinski Thumbs up

here's a patch for ascii2binary.c:

40a41
> #ifdef HAVE_LANGINFO_H
41a43
> #endif

Screenshot

Project Spotlight

TurnKey BugZilla Appliance

A BugZilla appliance that is easy to use and lightweight.

Screenshot

Project Spotlight

Observium

An autodiscovering network observation system.