Each object has its own Parse.com ObjectId, which is a char line 10 and, apparently, this creates a regular expression [0-9a-zA-Z]{10}.
Parse ObjectId example:
- X12wEq4sFf
- Weg243d21s
- zwg34GdsWE
I would like to convert this string to Long, because it will save memory and improve the search. (10 characters using UTF-8 are 40 bytes and 1 is 8 bytes long)
If we calculate the combinations, we can find:
- String ObjectId: 62 ^ 10 = 839299365868340224 different values;
- long: is 2 ^ 64 = 18446744073709551616 different values.
Thus, we can convert these values without loss of information. Is there an easy way to do this safely? Please consider any encoding for Chars (UTF-8, UTF-16, etc.);
EDIT: I just think this is hard to solve. I ask if there is an easy way.
Paulo source
share