adlnet / xAPIWrapper

Wrapper to simplify communication to an LRS
https://adlnet.gov/projects/xapi/
Apache License 2.0
219 stars 114 forks source link

Statement id collision (UUID v4) #90

Closed ryanrolds closed 6 years ago

ryanrolds commented 7 years ago

After generating about 5k statements across 40 devices (same model tablet) we encountered a id collision. JavaScript's Math.random() isn't that great of a PRNG and the Web Crypto API isn't widely supported yet. It may be better to use a v3/v5 UUID (hash versions) and use actor id + course id + activity + timestamp to produce UUIDs that are less likely to collide in this context.

If you're OK switching to v3 or v5 I'm happy to do the work.

ajanderson1209 commented 7 years ago

Hey Ryan thanks for the info. Yes it'd be great if you could make a pull request using this new functionality. Thanks!

ryanrolds commented 6 years ago

Rather then make this change I just had the xAPIWrapper not generate IDs for the statements. That way the LRS, which has a good PRNG/RNG, generates the UUIDs.