X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2FJU%2FAdler32.js;h=7855d3f269d014ee67b3bc5f0d38dc3bbee910a5;hp=3adbbdbb8a965011cfee9d8deb105225f550ee7b;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/JU/Adler32.js b/site/j2s/JU/Adler32.js index 3adbbdb..7855d3f 100644 --- a/site/j2s/JU/Adler32.js +++ b/site/j2s/JU/Adler32.js @@ -1,63 +1,63 @@ -Clazz.declarePackage ("JU"); -Clazz.load (["JU.Checksum"], "JU.Adler32", null, function () { -c$ = Clazz.decorateAsClass (function () { -this.s1 = 1; -this.s2 = 0; -this.b1 = null; -Clazz.instantialize (this, arguments); -}, JU, "Adler32", null, JU.Checksum); -Clazz.prepareFields (c$, function () { -this.b1 = Clazz.newByteArray (1, 0); -}); -Clazz.overrideMethod (c$, "resetLong", -function (init) { -this.s1 = init & 0xffff; -this.s2 = (init >> 16) & 0xffff; -}, "~N"); -Clazz.overrideMethod (c$, "reset", -function () { -this.s1 = 1; -this.s2 = 0; -}); -Clazz.overrideMethod (c$, "getValue", -function () { -return ((this.s2 << 16) | this.s1); -}); -Clazz.overrideMethod (c$, "update", -function (buf, index, len) { -if (len == 1) { -this.s1 += buf[index++] & 0xff; -this.s2 += this.s1; -this.s1 %= 65521; -this.s2 %= 65521; -return; -}var len1 = Clazz.doubleToInt (len / 5552); -var len2 = len % 5552; -while (len1-- > 0) { -var k = 5552; -len -= k; -while (k-- > 0) { -this.s1 += buf[index++] & 0xff; -this.s2 += this.s1; -} -this.s1 %= 65521; -this.s2 %= 65521; -} -var k = len2; -len -= k; -while (k-- > 0) { -this.s1 += buf[index++] & 0xff; -this.s2 += this.s1; -} -this.s1 %= 65521; -this.s2 %= 65521; -}, "~A,~N,~N"); -Clazz.overrideMethod (c$, "updateByteAsInt", -function (b) { -this.b1[0] = b; -this.update (this.b1, 0, 1); -}, "~N"); -Clazz.defineStatics (c$, -"BASE", 65521, -"NMAX", 5552); -}); +Clazz.declarePackage ("JU"); +Clazz.load (["JU.Checksum"], "JU.Adler32", null, function () { +c$ = Clazz.decorateAsClass (function () { +this.s1 = 1; +this.s2 = 0; +this.b1 = null; +Clazz.instantialize (this, arguments); +}, JU, "Adler32", null, JU.Checksum); +Clazz.prepareFields (c$, function () { +this.b1 = Clazz.newByteArray (1, 0); +}); +Clazz.overrideMethod (c$, "resetLong", +function (init) { +this.s1 = init & 0xffff; +this.s2 = (init >> 16) & 0xffff; +}, "~N"); +Clazz.overrideMethod (c$, "reset", +function () { +this.s1 = 1; +this.s2 = 0; +}); +Clazz.overrideMethod (c$, "getValue", +function () { +return ((this.s2 << 16) | this.s1); +}); +Clazz.overrideMethod (c$, "update", +function (buf, index, len) { +if (len == 1) { +this.s1 += buf[index++] & 0xff; +this.s2 += this.s1; +this.s1 %= 65521; +this.s2 %= 65521; +return; +}var len1 = Clazz.doubleToInt (len / 5552); +var len2 = len % 5552; +while (len1-- > 0) { +var k = 5552; +len -= k; +while (k-- > 0) { +this.s1 += buf[index++] & 0xff; +this.s2 += this.s1; +} +this.s1 %= 65521; +this.s2 %= 65521; +} +var k = len2; +len -= k; +while (k-- > 0) { +this.s1 += buf[index++] & 0xff; +this.s2 += this.s1; +} +this.s1 %= 65521; +this.s2 %= 65521; +}, "~A,~N,~N"); +Clazz.overrideMethod (c$, "updateByteAsInt", +function (b) { +this.b1[0] = b; +this.update (this.b1, 0, 1); +}, "~N"); +Clazz.defineStatics (c$, +"BASE", 65521, +"NMAX", 5552); +});