Skip to content

Commit

Permalink
Add common JS helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Kolář committed Aug 16, 2023
1 parent d08aa76 commit fe259f3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions static/js/crypto.js → static/js/helpers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
var ready = function (callback) {
if (document.readyState != 'loading') callback();
else document.addEventListener('DOMContentLoaded', callback);
};

var slugify = function (text) {
return text && text.trim().replace(/\s+/g, '-').toLowerCase();
};

var sha256 = function sha256(ascii) {
function rightRotate(value, amount) {
return (value>>>amount) | (value<<(32 - amount));
Expand Down

0 comments on commit fe259f3

Please sign in to comment.