You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cryptpad/customize.dist/email.js

24 lines
526 B
JavaScript

define(function () {
var Email = {};
var patt = /./g;
var each = function (d) {
d = d || 1;
return function (c, i) {
return String.fromCharCode((c.charCodeAt(0) + d));
};
};
Email.makeScrambler = function (n) {
return {
encrypt: function (S) {
return S.replace(patt, each(n));
},
decrypt: function (S) {
return S.replace(patt, each(-n));
}
};
};
return Email;
});