code: def bitmap2RRlist(bitmap):
      
      # RFC 4034, 4.1.2. The Type Bit Maps Field
  
      RRlist = []
  
      while bitmap:
  
          if len(bitmap) < 2:
              warning("bitmap too short (%i)" % len(bitmap))
              return
     
          #window_block = ord(bitmap[0]) # window number
          window_block = (bitmap[0]) # window number
          offset = 256*window_block # offset of the Ressource Record
          #bitmap_len = ord(bitmap[0]) # length of the bitmap in bytes
          bitmap_len = (bitmap[1]) # length of the bitmap in bytes
          
          if bitmap_len <= 0 or bitmap_len > 32:
              warning("bitmap length is no valid (%i)" % bitmap_len)
              return
          
          tmp_bitmap = bitmap[2:2+bitmap_len]
          
          # Let's compare each bit of tmp_bitmap and compute the real RR value
          for b in range(len(tmp_bitmap)):
              v = 128
              for i in range(8):
                  #if ord(tmp_bitmap[b]) & v:
                  if (tmp_bitmap[b]) & v:
                      # each of the RR is encoded as a bit
                      RRlist += [ offset + b*8 + i ] 
                  v = v >> 1
  
  # Next block if any
          bitmap = bitmap[2+bitmap_len:]
  
      return RRlist
docs: Decode the 'Type Bit Maps' field of the NSEC Resource Record into an 
      integer list.