/usr/local/lib/python3.9/site-packages/django/core/__pycache__
a Ӱ�hh% � @ s> d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m Z mZ ddlm Z ddlmZ ddlmZ ddlmZ ed �Zd ZG dd� de�ZG d d� de�Zdd� Zdd� Zdd� Zdd� Zd+dd�Zdd� Zd,dd�ZG dd � d �Z dd!e d"fd#d$�Z!dd!e ddfd%d&�Z"G d'd(� d(�Z#G d)d*� d*e#�Z$dS )-a_ Functions for creating and restoring url-safe signed JSON objects. The format used looks like this: >>> signing.dumps("hello") 'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk' There are two components here, separated by a ':'. The first component is a URLsafe base64 encoded JSON of the object passed to dumps(). The second component is a base64 encoded hmac/SHA-256 hash of "$first_component:$secret" signing.loads(s) checks the signature and returns the deserialized object. If the signature fails, a BadSignature exception is raised. >>> signing.loads("ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk") 'hello' >>> signing.loads("ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv42-modified") ... BadSignature: Signature "ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv42-modified" does not match You can optionally compress the JSON prior to base64 encoding it to save space, using the compress=True argument. This checks if compression actually helps and only applies compression if the result is a shorter string: >>> signing.dumps(list(range(1, 20)), compress=True) '.eJwFwcERACAIwLCF-rCiILN47r-GyZVJsNgkxaFxoDgxcOHGxMKD_T7vhAml:1QaUaL:BA0thEZrp4FQVXIXuOvYJtLJSrQ' The fact that the string is compressed is signalled by the prefixed '.' at the start of the base64 JSON. There are 65 url-safe characters: the 64 used by url-safe base64 and the ':'. These functions make use of all of them. � N)�settings)�constant_time_compare�salted_hmac)�RemovedInDjango51Warning��force_bytes)� import_string)�_lazy_re_compilez^[A-z0-9-_=]*$Z>0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzc @ s e Zd ZdZdS )�BadSignaturezSignature does not match.N��__name__� __module__�__qualname__�__doc__� r r �=/usr/local/lib/python3.9/site-packages/django/core/signing.pyr 6 s r c @ s e Zd ZdZdS )�SignatureExpiredz3Signature timestamp is older than required max_age.Nr r r r r r <