| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -969,6 +969,8 @@ function crc32(data, value = 0) { | |||
| 969 | 969 | throw new ERR_INVALID_ARG_TYPE('data', ['Buffer', 'TypedArray', 'DataView', 'string'], data); | |
| 970 | 970 | } | |
| 971 | 971 | validateUint32(value, 'value'); | |
| 972 | + // Coerce -0 to +0. | ||
| 973 | + value += 0; | ||
| 972 | 974 | return crc32Native(data, value); | |
| 973 | 975 | } | |
| 974 | 976 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,8 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + require('../common'); | ||
| 4 | + | ||
| 5 | + const assert = require('assert'); | ||
| 6 | + const zlib = require('zlib'); | ||
| 7 | + | ||
| 8 | + assert.strictEqual(zlib.crc32('', -0), zlib.crc32('', 0)); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments