Project

General

Profile

« Previous | Next » 

Revision 792

Added by doc about 16 years ago

added handling of missing characters to mailto encryption routines

View differences:

mdcr.js
8 8

  
9 9
function sdcr(a,f) {
10 10
  var b = a.charCodeAt(a.length-1) -97;
11
  var c=""; var e;
11
  var c=""; var e; var g;
12 12
  
13 13
  for(var d=a.length-2; d>-1; d--) {
14 14
    if(a.charCodeAt(d) < 97) {
15
      if(a.charCodeAt(d) == 70) { c+=String.fromCharCode(64); }
16
      if(a.charCodeAt(d) == 90) { c+=String.fromCharCode(46); }
17
      if(a.charCodeAt(d) == 88) { c+=String.fromCharCode(95); }
18
      if(a.charCodeAt(d) == 45) { c+=String.fromCharCode(45); }
15
      switch(a.charCodeAt(d)) {
16
	case 70: g=64; break;
17
	case 90: g=46; break;
18
      	case 88: g=95; break;
19
      	case 45: g=45; break;
20
	default: g=a.charCodeAt(d); break;
21
      }
22
      c+=String.fromCharCode(g)
19 23
    } else {
20 24
      e=(a.charCodeAt(d) - 97 - b) % 26;
21 25
      e+=(e<0 || e>25) ? +26 : 0;

Also available in: Unified diff