{
  "id": 384678,
  "title": "Session ID Reverse Engineering",
  "url": "/competitions/predict-student-performance-from-game-play/discussion/384678",
  "author_name": "",
  "post_date": "2023-02-08T23:09:30.404518800Z",
  "votes": 9,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Column <code>session_id</code> seems to contain date and time information: <a href=\"https://www.kaggle.com/code/pdnartreb/session-id-reverse-engineering\" target=\"_blank\">https://www.kaggle.com/code/pdnartreb/session-id-reverse-engineering</a>.</p>\n<p>What do you think about the last 2 digits?</p>",
  "messages": [
    {
      "id": "2135869",
      "postDate": "02/08/2023 23:09:30",
      "content": "<p>Column <code>session_id</code> seems to contain date and time information: <a href=\"https://www.kaggle.com/code/pdnartreb/session-id-reverse-engineering\" target=\"_blank\">https://www.kaggle.com/code/pdnartreb/session-id-reverse-engineering</a>.</p>\n<p>What do you think about the last 2 digits?</p>",
      "rawMarkdown": "Column `session_id` seems to contain date and time information: https://www.kaggle.com/code/pdnartreb/session-id-reverse-engineering.\n\nWhat do you think about the last 2 digits?",
      "votes": null
    },
    {
      "id": "2136338",
      "postDate": "02/09/2023 09:03:30",
      "content": "<p>a geographical zone ? a personnal identifier ?</p>",
      "rawMarkdown": "a geographical zone ? a personnal identifier ?",
      "votes": null
    },
    {
      "id": "2217551",
      "postDate": "04/11/2023 02:24:54",
      "content": "<p>The last 5 numbers of session_id are all generated randomly. The js code are:</p>\n<p>*var UUIDint = function() //17 digits = 64 bit int; each second guaranteed unique, within a second = 1/99999 chance of collision (aka \"not unique\")</p>\n<p>{<br>\n  var d = new Date();</p>\n<p>var id = (\"\"+d.getFullYear()).substring(2); //2</p>\n<p>if(d.getMonth() &lt; 10) id += \"0\";</p>\n<p>id += d.getMonth(); //4</p>\n<p>if(d.getDay() &lt; 10) id += \"0\";</p>\n<p>id += d.getDay(); //6</p>\n<p>if(d.getHours() &lt; 10) id += \"0\";</p>\n<p>id += d.getHours(); //8</p>\n<p>if(d.getMinutes() &lt; 10)  id += \"0\";</p>\n<p>id += d.getMinutes(); //10</p>\n<p>if(d.getSeconds() &lt; 10)  id += \"0\";</p>\n<p>id += d.getSeconds(); //12</p>\n<p>for(var i = 0; i &lt; 5; i++)</p>\n<pre><code>id += Math.floor(Math.random()*10); //17\n</code></pre>\n<p>return parseInt(id);*</p>\n<p>The last num isn't uniform ditribution according to your statistics. That's caused by the  \"parseInt(id)\" function.  The max num length of this function can deal with is 16, but the session_id length is 17. So the last num is turned into even num by the \"parseInt()\" func somehow.<br>\n If you keep add num length, the num will be all 0 from the 18th.<br>\nYou can confirm this in the chrom js debug tool.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7243681%2F44f37726c7d91403b17a8e4b833756fa%2Fimg0.png?generation=1681179862705957&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "The last 5 numbers of session_id are all generated randomly. The js code are:\n\n*var UUIDint = function() //17 digits = 64 bit int; each second guaranteed unique, within a second = 1/99999 chance of collision (aka \"not unique\")\n\n{\n  var d = new Date();\n\n  var id = (\"\"+d.getFullYear()).substring(2); //2\n\n  if(d.getMonth() < 10) id += \"0\";\n\n  id += d.getMonth(); //4\n\n  if(d.getDay() < 10) id += \"0\";\n\n  id += d.getDay(); //6\n\n  if(d.getHours() < 10) id += \"0\";\n\n  id += d.getHours(); //8\n\n  if(d.getMinutes() < 10)  id += \"0\";\n\n  id += d.getMinutes(); //10\n\n  if(d.getSeconds() < 10)  id += \"0\";\n\n  id += d.getSeconds(); //12\n\n  for(var i = 0; i < 5; i++)\n\n    id += Math.floor(Math.random()*10); //17\n\n  return parseInt(id);*\n\nThe last num isn't uniform ditribution according to your statistics. That's caused by the  \"parseInt(id)\" function.  The max num length of this function can deal with is 16, but the session_id length is 17. So the last num is turned into even num by the \"parseInt()\" func somehow.\n If you keep add num length, the num will be all 0 from the 18th.\nYou can confirm this in the chrom js debug tool.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7243681%2F44f37726c7d91403b17a8e4b833756fa%2Fimg0.png?generation=1681179862705957&alt=media)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2136338,
      "author_name": "lucasmorin",
      "author_url": "",
      "post_date": "02/09/2023 09:03:30",
      "content": "<p>a geographical zone ? a personnal identifier ?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2217551,
      "author_name": "huoyeqianxun",
      "author_url": "",
      "post_date": "04/11/2023 02:24:54",
      "content": "<p>The last 5 numbers of session_id are all generated randomly. The js code are:</p>\n<p>*var UUIDint = function() //17 digits = 64 bit int; each second guaranteed unique, within a second = 1/99999 chance of collision (aka \"not unique\")</p>\n<p>{<br>\n  var d = new Date();</p>\n<p>var id = (\"\"+d.getFullYear()).substring(2); //2</p>\n<p>if(d.getMonth() &lt; 10) id += \"0\";</p>\n<p>id += d.getMonth(); //4</p>\n<p>if(d.getDay() &lt; 10) id += \"0\";</p>\n<p>id += d.getDay(); //6</p>\n<p>if(d.getHours() &lt; 10) id += \"0\";</p>\n<p>id += d.getHours(); //8</p>\n<p>if(d.getMinutes() &lt; 10)  id += \"0\";</p>\n<p>id += d.getMinutes(); //10</p>\n<p>if(d.getSeconds() &lt; 10)  id += \"0\";</p>\n<p>id += d.getSeconds(); //12</p>\n<p>for(var i = 0; i &lt; 5; i++)</p>\n<pre><code>id += Math.floor(Math.random()*10); //17\n</code></pre>\n<p>return parseInt(id);*</p>\n<p>The last num isn't uniform ditribution according to your statistics. That's caused by the  \"parseInt(id)\" function.  The max num length of this function can deal with is 16, but the session_id length is 17. So the last num is turned into even num by the \"parseInt()\" func somehow.<br>\n If you keep add num length, the num will be all 0 from the 18th.<br>\nYou can confirm this in the chrom js debug tool.<br>\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7243681%2F44f37726c7d91403b17a8e4b833756fa%2Fimg0.png?generation=1681179862705957&amp;alt=media\" alt=\"\"></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2135869": "Column `session_id` seems to contain date and time information: https://www.kaggle.com/code/pdnartreb/session-id-reverse-engineering.\n\nWhat do you think about the last 2 digits?",
    "2136338": "a geographical zone ? a personnal identifier ?",
    "2217551": "The last 5 numbers of session_id are all generated randomly. The js code are:\n\n*var UUIDint = function() //17 digits = 64 bit int; each second guaranteed unique, within a second = 1/99999 chance of collision (aka \"not unique\")\n\n{\n  var d = new Date();\n\n  var id = (\"\"+d.getFullYear()).substring(2); //2\n\n  if(d.getMonth() < 10) id += \"0\";\n\n  id += d.getMonth(); //4\n\n  if(d.getDay() < 10) id += \"0\";\n\n  id += d.getDay(); //6\n\n  if(d.getHours() < 10) id += \"0\";\n\n  id += d.getHours(); //8\n\n  if(d.getMinutes() < 10)  id += \"0\";\n\n  id += d.getMinutes(); //10\n\n  if(d.getSeconds() < 10)  id += \"0\";\n\n  id += d.getSeconds(); //12\n\n  for(var i = 0; i < 5; i++)\n\n    id += Math.floor(Math.random()*10); //17\n\n  return parseInt(id);*\n\nThe last num isn't uniform ditribution according to your statistics. That's caused by the  \"parseInt(id)\" function.  The max num length of this function can deal with is 16, but the session_id length is 17. So the last num is turned into even num by the \"parseInt()\" func somehow.\n If you keep add num length, the num will be all 0 from the 18th.\nYou can confirm this in the chrom js debug tool.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F7243681%2F44f37726c7d91403b17a8e4b833756fa%2Fimg0.png?generation=1681179862705957&alt=media)"
  },
  "source": "meta"
}