vendredi 7 décembre 2018

Generating Identification Number of String Bundle

Assume that you have a struct called bundle and it consists of string objects. There is no accurate knowledge about how many strings a bundle will contain, and you need to generate identification number for each bundle so that you can differentiate them.

For example, two bundles have 5 string objects and only four of them are common for these two objects.

Note 1: I need an identification number because I face a lot of bundles in the process and some of them have exactly same strings.

Note 2: I work on c++, and as far as I know, there is no hashable or something like that in c++.

How can we generate identification number ?

The only solution which came to my mind is to concatenate string objects in a bundle. I think that there is no any other solution. Maybe representing strings in another format or a data structure can make it easier to generate an id.




Aucun commentaire:

Enregistrer un commentaire