Login   Register  
Icontem

File: libs/js/pidCrypt/javascripts/compressed/sha1_c.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jason Gerfen  >  jQuery.pidCrypt  >  libs/js/pidCrypt/javascripts/compressed/sha1_c.js  >  Download  
File: libs/js/pidCrypt/javascripts/compressed/sha1_c.js
Role: Application script
Content type: text/plain
Description: Application script
Class: jQuery.pidCrypt
Encrypt form values using RSA and AES
Author: By
Last change:
Date: 2012-05-21 06:18
Size: 1,629 bytes
 

Contents

Class file image Download
if(typeof(pidCrypt)!="undefined"){pidCrypt.SHA1=function(d){function c(x,j){var i=(x<<j)|(x>>>(32-j));return i}function r(z){var y="";var j;var A;var x;for(j=0;j<=6;j+=2){A=(z>>>(j*4+4))&15;x=(z>>>(j*4))&15;y+=A.toString(16)+x.toString(16)}return y}function t(z){var y="";var x;var j;for(x=7;x>=0;x--){j=(z>>>(x*4))&15;y+=j.toString(16)}return y}var g;var v,u;var b=new Array(80);var m=1732584193;var k=4023233417;var h=2562383102;var f=271733878;var e=3285377520;var s,q,p,o,n;var w;var a=d.length;var l=new Array();for(v=0;v<a-3;v+=4){u=d.charCodeAt(v)<<24|d.charCodeAt(v+1)<<16|d.charCodeAt(v+2)<<8|d.charCodeAt(v+3);l.push(u)}switch(a%4){case 0:v=2147483648;break;case 1:v=d.charCodeAt(a-1)<<24|8388608;break;case 2:v=d.charCodeAt(a-2)<<24|d.charCodeAt(a-1)<<16|32768;break;case 3:v=d.charCodeAt(a-3)<<24|d.charCodeAt(a-2)<<16|d.charCodeAt(a-1)<<8|128;break}l.push(v);while((l.length%16)!=14){l.push(0)}l.push(a>>>29);l.push((a<<3)&4294967295);for(g=0;g<l.length;g+=16){for(v=0;v<16;v++){b[v]=l[g+v]}for(v=16;v<=79;v++){b[v]=c(b[v-3]^b[v-8]^b[v-14]^b[v-16],1)}s=m;q=k;p=h;o=f;n=e;for(v=0;v<=19;v++){w=(c(s,5)+((q&p)|(~q&o))+n+b[v]+1518500249)&4294967295;n=o;o=p;p=c(q,30);q=s;s=w}for(v=20;v<=39;v++){w=(c(s,5)+(q^p^o)+n+b[v]+1859775393)&4294967295;n=o;o=p;p=c(q,30);q=s;s=w}for(v=40;v<=59;v++){w=(c(s,5)+((q&p)|(q&o)|(p&o))+n+b[v]+2400959708)&4294967295;n=o;o=p;p=c(q,30);q=s;s=w}for(v=60;v<=79;v++){w=(c(s,5)+(q^p^o)+n+b[v]+3395469782)&4294967295;n=o;o=p;p=c(q,30);q=s;s=w}m=(m+s)&4294967295;k=(k+q)&4294967295;h=(h+p)&4294967295;f=(f+o)&4294967295;e=(e+n)&4294967295}var w=t(m)+t(k)+t(h)+t(f)+t(e);return w.toLowerCase()}};