Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[crc32] ensure results are always unsigned
With longer inputs, previous crc-32 can give signed (negative) results, which are incorrect. This patch shifts the result right-wise, filling in the left with zeros, to ensure the result is unsigned (unlike the C++ implementation, JS lacks a standard unsigned type). I used OS X's "cksum -o3" command to get the expected CRC-32 output for the test file.
- Loading branch information
Showing
3 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<html> | ||
<head></head> | ||
<body> | ||
<h1>Child Browser Demo</h1> | ||
|
||
<a onClick="launchBrowser()" href="#">What does it do?</a> | ||
|
||
</body> | ||
<script src="phonegap.js"></script> | ||
<script src="childbrowser.js"></script> | ||
<script> | ||
var url = 'http://www.youtube.com/watch?v=R4vpXS5BKyc' | ||
function launchBrowser() { | ||
window.plugins.childBrowser.showWebPage(url, | ||
{ showLocationBar: true }); | ||
} | ||
</script> | ||
</html> |