48ff898685826a5c37e1914d05ad59408b267528,debug_toolbar/panels/sql/forms.py,SQLSelectForm,make_hash,#SQLSelectForm#Any#,81

Before Change


        items = [data["sql"], data["params"]]
        // Replace lines endings with spaces to preserve the hash value
        // even when the browser normalizes \r\n to \n in inputs.
        items = [" ".join(force_text(item).splitlines()) for item in items]
        return hmac.new(settings.SECRET_KEY.encode("utf-8"),
                        "".join(items).encode("utf-8"), hashlib.sha1).hexdigest()

    @property

After Change



    def make_hash(self, data):
        m = hmac.new(key=force_bytes(settings.SECRET_KEY), digestmod=hashlib.sha1)
        for item in [data["sql"], data["params"]]:
            m.update(force_bytes(item))
        return m.hexdigest()

    @property
    def connection(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: jazzband/django-debug-toolbar
Commit Name: 48ff898685826a5c37e1914d05ad59408b267528
Time: 2016-11-07
Author: mejiaa@amazon.com
File Name: debug_toolbar/panels/sql/forms.py
Class Name: SQLSelectForm
Method Name: make_hash


Project Name: eth-cscs/reframe
Commit Name: c323ba31063d782f2beaa4fb66a4943c19018936
Time: 2019-11-20
Author: manitaras@cscs.ch
File Name: reframe/core/schedulers/slurm.py
Class Name: SlurmJob
Method Name: get_all_nodes


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: e2940262d14cc2479fd1e14c89679464d34aca46
Time: 2019-10-30
Author: chriswilkes@google.com
File Name: perfkitbenchmarker/linux_virtual_machine.py
Class Name: LsCpuResults
Method Name: __init__