daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Sep 24th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Number.prototype.unsign = function(bytes) {  return this >= 0 ? this : Math.pow(256, bytes || 4) + this; };
  2. Number.prototype.between = function(min,max) {   return (this >= min && this <= max) ? 1 : 0; }
  3.  
  4. function get_domain() {
  5.   var urls = new Array("url1","url2","url3","url4","url5");
  6.   var checksum = 0xffffffff;
  7.   var val = 0x33333333;
  8.   var seed = document.location.hostname.toLowerCase();
  9.   if (seed == "") {
  10.     seed = "facebook.com";
  11.   }
  12.   for (var j=0; j<seed.length; j++) {
  13.     var c = seed.charCodeAt(j);
  14.     checksum ^= c << 24;
  15.     for (var i = 0; i<8; i++) {
  16.         if (checksum.unsign(8) & 0x80000000) {
  17.           checksum = (checksum << 1) ^ 0x04C11DB7;
  18.         } else {
  19.           checksum <<= 1;
  20.         }
  21.      }
  22.   }
  23.   if ( checksum < 0 ) {
  24.      checksum = checksum >>> 0;
  25.   }
  26.   for (var i = 0xFFFFFFFF, num = 0;num < 5;i -= val,num++) {
  27.      if(checksum.between(i - val, i)) {
  28.         return urls[num];
  29.      }
  30.   }
  31. }
  32. alert(get_domain());
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top