0

GCM Ids look like this:

APA91bEMUGVEW6Z3dtzE8RwzSDEQQaCIviSnnwLJyrElcTeZrE7QsOvVYc6p4s9-KWmOCyyqekc_uXV4gNaiLl95b3EuT7kc-k1WdAlPzEfbhgwfVzIh-FUMdyof4CUK-6h4A5uo9LyfApss8sd1A7ry0Z-FNOSqk8AS5G4iJx2Pr-8OJU9XsUg

This is a string of length around 200.

If we just use a-z, A-Z and 0-9, then using a string of length 20, we have a space of ~60^20 which is ~10^35 strings, which should be enough for foreseeable future. Then why does google choose to have such long GCM ids?

Note: In my project, I need to deal with potentially millions of GCM Ids and copying and comparing such large strings is going to cause some overhead which could have been avoided.

Vivek Pandey
  • 3,455
  • 1
  • 19
  • 25
  • 1
    FWIW, apparently the spec says it can be up to 4K: http://stackoverflow.com/a/13713128/14955 – Thilo Feb 16 '15 at 06:57
  • GCM documentation do not provide this info. Googling for this reveals that `Registration ID` is not fixed length in nature and can be up to `4K (4096 bytes)` in length. – bjiang Feb 17 '15 at 20:27

1 Answers1

0

By now I have the theory that they are long because they encode device/app information in them. That way, Google would be easily able to determine device/app by looking at the GCM id alone and would not need to consult some lookup table to determine that.

Vivek Pandey
  • 3,455
  • 1
  • 19
  • 25