code: def _truncate_bitmap(what):
      
  
      for i in xrange(len(what) - 1, -1, -1):
          if what[i] != '\x00':
              break
      return ''.join(what[0 : i + 1])
docs: Determine the index of greatest byte that isn't all zeros, and
      return the bitmap that contains all the bytes less than that index.
  
      @param what: a string of octets representing a bitmap.
      @type what: string
      @rtype: string