All-optical digital 4 × 2 encoder based on 2D photonic crystal ring resonators