The Jargon File (version 4.4.7, 29 Dec 2003):
bit bashing
 n.
    (alt.: bit diddling or bit twiddling) Term used to describe any of
    several kinds of low-level programming characterized by manipulation of 
    bit, flag, nybble, and other smaller-than-character-sized pieces of
    data; these include low-level device control, encryption algorithms,
    checksum and error-correcting codes, hash functions, some flavors of
    graphics programming (see bitblt), and assembler/compiler code
    generation. May connote either tedium or a real technical challenge (more
    usually the former). ?The command decoding for the new tape driver looks
    pretty solid but the bit-bashing for the control registers still has bugs.?
    See also mode bit.
The Free On-line Dictionary of Computing (30 December 2018):
bit bashing
bit diddling
   (Also "bit diddling" or bit twiddling).  Any of several
   kinds of low-level programming characterised by manipulation
   of bit, flag, nibble, and other
   smaller-than-character-sized pieces of data.  These include
   low-level device control, encryption algorithms, checksum and
   error-correcting codes, hash functions, some flavours of
   graphics programming (see bitblt), and assembler/compiler
   code generation.  May connote either tedium or a real
   technical challenge (more usually the former).  "The command
   decoding for the new tape driver looks pretty solid but the
   bit-bashing for the control registers still has bugs."  See
   also bit bang, mode bit.