All pastes #290639 Raw Edit

Miscellany

public text v1 · immutable
#290639 ·published 2006-12-24 05:52 UTC
rendered paste body
  function testEncode() {
    var dater = new Date();
    Day = dater.getDate();
    dater = null;
    Ret = encode(document.formular.user.value, Day);
    location = Ret+".php";
  }
  function encode (OrigString, CipherVal) {
    Ref="0123456789abcdefghijklmnopqrstuvwxyz._~ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    CipherVal = parseInt(CipherVal);
    var Temp="";
    for (Count=0; Count < OrigString.length; Count++) {
      TempChar = OrigString.substring (Count, Count+1);
      Conv = cton(Ref, TempChar);
      Cipher=Conv^CipherVal;
      Cipher=ntoc(Ref, Cipher);
      Temp += Cipher;
    }
    return (Temp);
  }
  function cton (Ref, Char) {
    return (Ref.indexOf(Char));
  }
  function ntoc (Ref, Val) {
    return (Ref.substring(Val, Val+1));
  }