How can I get the hex value of CRC32 #12

Closed
opened 2018-08-01 22:19:30 +00:00 by hhovakimyan · 1 comment
hhovakimyan commented 2018-08-01 22:19:30 +00:00 (Migrated from github.com)

I want to get the hex value of CRC32, but I can not, cause the result is always decimal. Is the only option to covert decimal to hex format manually.

I want to get the hex value of CRC32, but I can not, cause the result is always decimal. Is the only option to covert decimal to hex format manually.
SheetJSDev commented 2018-08-01 22:40:59 +00:00 (Migrated from github.com)

the return value is a signed 32 bit integer. crc>>>0 is an unsigned 32 bit int, (crc >>>0).toString(16) is the hex string without padding, and (crc >>>0).toString(16).padStart(8, '0') is the hex string with padding

the return value is a signed 32 bit integer. `crc>>>0` is an unsigned 32 bit int, `(crc >>>0).toString(16)` is the hex string without padding, and `(crc >>>0).toString(16).padStart(8, '0')` is the hex string with padding
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/js-crc32#12
No description provided.