djangosnippets.org: Latest snippets tagged with 'obfuscation'https://djangosnippets.org/tags/obfuscation/2015-02-08T11:00:05.147946-06:00Django Template - obfuscate a javascript string
2015-02-08T11:00:05.147946-06:00oriadamhttps://djangosnippets.org/snippets/10461/<p>Obfuscate javascript strings.</p>
<ul>
<li>Convert </li>
<li><code>{{'Pita Hummus'|js_obfuscate_string}}</code></li>
<li>to something like </li>
<li><code>'P4itzga Hnumg7mubs'.replace(/[4zgn7b]/g,'')</code></li>
</ul>
<p>Making it hard to text-search for strings in your code.</p>
Freely redistributablePassword Obfuscation Log Filter
2013-06-28T17:08:04.046722-05:00nikmolnarhttps://djangosnippets.org/snippets/2966/<p>This is a simple logging <a href="https://docs.djangoproject.com/en/1.5/topics/logging/#topic-logging-parts-filters">filter</a> to ensure that user-entered passwords aren't recorded in the log or emailed to admins as part of the request data if an error occurs during registration/login.</p>
Freely redistributableRandom object IDs using an abstract base model
2011-07-15T06:25:15.057845-05:00elverhttps://djangosnippets.org/snippets/2490/<p>To put obfuscated primary keys in any class, simply inherit from this one. For example:</p>
<p>class Offer(ObfuscatedPKModel)</p>
<p>You can match for these bigint primary keys in your urls.py like this:</p>
<p>'^offer/(?P<offer_pk>[0-9-]+)$'</p>
Freely redistributableEmail obfuscation filter using ROT13
2009-04-28T19:56:57.492810-05:00worksologyhttps://djangosnippets.org/snippets/1475/<p>An email address obfuscation template filter based on the ROT13 Encryption function in Textmate's HTML bundle.</p>
<p>The filter should be applied to a string representing an email address. You can optionally pass the filter an argument that will be used as the email link text (otherwise it will simply use …</p>
Freely redistributable