flip

flip - reverse order of bits in a file

SYNOPSIS

flip [-b block_size_bytes] [-w word_size_bits] [input_file [output_file]]

DESCRIPTION

flip reverses order of bits in a file. The input_file optional parameter specifies input file, by default stdin. The output_file optional parameter specifies output_file, by default stdout.

The options are as follows:

-b block_size_bytes
Divide the file into blocks of block_size_bytes and reverse order of bits within each block. By default the whole file is treated as one block. This option is mandatory if input is stdin.
-w word_size_bits
Treat word_size_bits number of consecutive bits as one unit (word). The program does not change the order of bits within the unit. By default one bit is treated as one unit.

USE CASES

flip -b 4 -w 8
- converts input of 4-byte words from little-endian byte order to big-endian, and visa-versa.
flip -b 8 -w 8
- converts input of 8-byte words from little-endian byte order to big-endian, and visa-versa.
flip input_file
- completely reverses order of bits in the input_file. For example it will convert the string of bits 01110010 into 01001110.

flip input_file
 - is equivalent to
flip -w 1 input_file
The following command converts the string of bits 01110010 into 10001101:
flip -w 2 input_file

DOWNLOAD

The flip executables for Linux,AIX 6.1,Windows 7 are available for download:
Linux x86flip_linux_x86.tgz
Linux x86 64-bitflip_linux_x86_64.tgz
AIX 6.1 64-bitflip_aix61_64.tgz
Windows 7 (cygwin)flip_cygwin.tgz

BUGS

The functionality of flip should be merged into GNU dd

AUTHORS

Sergei Viznyuk <phystech@hotmail.com>


©1998 PhysTech, Inc. All rights reserved. Last change: Feb.8, 2015