Hello, Murat!
It is better to sync by code or date + number if you can be sure that users input them unique. To make sure that numbers that were inputed in different infobase nodes are unique, you should set up prefixes for codes and numbers.
As an example, in infobase node A users input codes 1, 2, 3, the application saves them as A0000001, A0000002, A0000003. In the infobase node B codes will be B0000001, B0000002. Thus when you merge the data in the master node, you will have both A0000001, A0000002, A0000003, B0000001, B0000002 and there will be no conflict between them.
Using Ref attribute leads to the following effect: when you delete an item in the infobase with the Delete marked objects data processor, and create a new one with the same code as a replacement, they will not merge. The difference is in merge effect. If you would like items to merge, you need to use a set of another attributes, if you don't - use Ref.
The algorithm of UUID generation does not depend on Code or Number and you can't extract or replace it in the UUID.