1 // Test the performance of Int8Array by implementing Adler32.
3 function adler32(array
)
10 /* Process each byte of the data in order */
11 for (index
= 0; index
< array
.byteLength
; ++index
)
13 a
= (a
+ array
[index
]) % MOD_ADLER
;
14 b
= (b
+ a
) % MOD_ADLER
;
20 var array
= new Int8Array(1000);
21 for (var i
= 0; i
< array
.byteLength
; ++i
)
25 for (var i
= 0; i
< 300; ++i
)
26 result
+= adler32(array
);
29 throw "Bad result: " + result
;