Code lock and RFID lock