title: TimedJSONWebSignatureSerializer vs URLSafeTimedSerializer: When should I use what?
body: <p>I found <a href="https://github.com/pallets/itsdangerous/blob/master/src/itsdangerous/jws.py#L157" rel="nofollow noreferrer"><code>TimedJSONWebSignatureSerializer</code></a> and <a href="https://pythonhosted.org/itsdangerous/#itsdangerous.URLSafeTimedSerializer" rel="nofollow noreferrer"><code>URLSafeTimedSerializer</code></a>. I wonder why those two methods exist. As a user of that library, what are reasons to chose one or the  other?</p>
  
  <h2>What I've tried</h2>
  
  <p>I didn't even find <code>TimedJSONWebSignatureSerializer</code> in the <strong>docs</strong>, but only <a href="https://pythonhosted.org/itsdangerous/#json-web-signatures" rel="nofollow noreferrer">something general about JSON Web Signatures</a>. </p>
  
  <p>Looking at the <strong>inheritance</strong> did not help:</p>
  
  <ul>
  <li><code>TimedJSONWebSignatureSerializer</code> inherits from <code>JSONWebSignatureSerializer</code></li>
  <li><code>URLSafeTimedSerializer</code> inherits from <code>URLSafeSerializerMixin</code>, <code>TimedSerializer</code></li>
  </ul>
  
  <p>Looking at the <strong>constructors</strong>, I have the impression that both might be for the same use cases, but maybe the JSON Web Signatures are standardized while the other one isn't?</p>
  
  <p>Looking at <strong>usage</strong>:</p>
  
  <pre><code>from itsdangerous import TimedJSONWebSignatureSerializer, URLSafeTimedSerializer
  
  data = {"id": 42, "op": "foobar"}
  max_age_s = 123
  
  s1 = TimedJSONWebSignatureSerializer('secret', expires_in=max_age_s)
  s1_dumped = s1.dumps(data)
  s1_loaded = s1.loads(s1_dumped)
  
  s2 = URLSafeTimedSerializer('secret')
  s2_dumped = s2.dumps(data)
  s2_loaded = s2.loads(s2_dumped, max_age=max_age_s)
  </code></pre>
  
  <p>Then</p>
  
  <pre><code>&gt;&gt;&gt; s1_dumped
  b'eyJhbGciOiJIUzUxMiIsImlhdCI6MTU2MTEwNDU0NSwiZXhwIjoxNTYxMTA4MTQ1fQ.eyJpZCI6NDIsIm9wIjoiZm9vYmFyIn0.sux9j4OpBc7-se16WSrZvp-bll5ZeyCQR_CumSE7jPQ9-w_kTqpr0OtwhJp8S766Xt1W3fKSE-dl2z8q9ZAhzg'
  &gt;&gt;&gt; s2_dumped
  'eyJpZCI6NDIsIm9wIjoiZm9vYmFyIn0.XQyQoQ.-6n5Jw6TWz8tsyfgagyS5_fHjAY'
  &gt;&gt;&gt; len(s1_dumped)
  185
  &gt;&gt;&gt; len(s2_dumped)
  66
  </code></pre>
  
  <p>Hence the JSON Web Signature is way longer. What do you win by having it?</p>