Answers.Body: <p>Welcome to SE!</p>
  <p>You can see the construction of the opt-out URL <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/BAO/Mailing.php#L1001" rel="nofollow noreferrer">here</a> and the processing of it <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/Form/Optout.php" rel="nofollow noreferrer">here</a></p>
  <ul>
  <li>'jid' is the Job id</li>
  <li>'qid' is the Queue id</li>
  <li>'h' is the Hash</li>
  </ul>
  <p>The contact_id is not included in the URL but can be looked up via the qid.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-05T11:31:02.500Z
Answers.Text: thanks a lot !!! will have a look ;-)
Answers.UserDisplayName: thedi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-05T11:49:39.953Z
Answers.Text: thanks again Aidan: the related DB-table is
        civicrm_mailing_event_queue (id. job_id)  => contact_id
  
  You made my day ;-)  thx !!!!
Answers.UserDisplayName: thedi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-05T10:15:00.853Z
Answers.LastActivityDate: 2021-05-05T10:15:00.853Z
Answers.UserDisplayName: Aidan
Body: <p>is someone there who knows how the en-/decoding of the optOt-URL is implemented ?</p>
  <p>Example:
  https://....../crm/civicrm/mailing/optout?reset=1&amp;jid=7&amp;qid=14&amp;h=817b324557dc9cb9</p>
  <p>I'd assume that the part &quot;817b324557dc9cb9&quot; is the encoded contact_id 15944 ???</p>
  <p>Please help me ;-)
  Thanks a lot and kind regards
  Dieter</p>
  <p>p.s.:
  <a href="https://gchq.github.io/CyberChef/" rel="nofollow noreferrer">https://gchq.github.io/CyberChef/</a>
  =&gt; Analyse hash:  817b324557dc9cb9
  Hash length: 16
  Byte length: 8
  Bit length:  64</p>
  <p>Based on the length, this hash could have been generated by one of the following hashing functions:
  CRC-64
  RIPEMD-64
  SipHash</p>
  
Tags: <civicrm.org>
Title: How is the en-/decoding of the optOut-URL done ? (algorithm)
ThreadText: # How is the en-/decoding of the optOut-URL done ? (algorithm)
  
  (Asked by: username_0 on 2021-05-05)
  
  is someone there who knows how the en-/decoding of the optOt-URL is implemented ?
  
  Example:
  https://....../crm/civicrm/mailing/optout?reset=1&jid=7&qid=14&h=817b324557dc9cb9
  
  I'd assume that the part "817b324557dc9cb9" is the encoded contact\_id 15944 ???
  
  Please help me ;-)
  Thanks a lot and kind regards
  Dieter
  
  p.s.:
  <https://gchq.github.io/CyberChef/>
  => Analyse hash: 817b324557dc9cb9
  Hash length: 16
  Byte length: 8
  Bit length: 64
  
  Based on the length, this hash could have been generated by one of the following hashing functions:
  CRC-64
  RIPEMD-64
  SipHash
  
  **Tags:** civicrm.org
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-05-05. Score: 3
  
  Welcome to SE!
  
  You can see the construction of the opt-out URL [here](https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/BAO/Mailing.php#L1001) and the processing of it [here](https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/Form/Optout.php)
  
  * 'jid' is the Job id
  * 'qid' is the Queue id
  * 'h' is the Hash
  
  The contact\_id is not included in the URL but can be looked up via the qid.
  
  > **Comments:**
  > **username_0**: thanks a lot !!! will have a look ;-)  
  > **username_0**: thanks again username_1: the related DB-table is       civicrm_mailing_event_queue (id. job_id)  => contact_id  You made my day ;-)  thx !!!!  
  
  ---
  
  