A sub-package within tcllib's crc module.
TWu - 2025-09-10 13:37:01
At version Tcl/Tk 9.0.1 the command crc32 (version 1.3.4) may fail with error message "integer value too large to represent". A tcllib-ticket is already opened.
It happens as file as well as channel - regardless of the (correct) encoding of the source or open it with encoding iso8859-1 (replacement for binary).
UliE - 2025-09-12 09:17:52
# I got the same result at version Tcl/Tk 9.0.2 the command crc32 (version 1.3.4) using Wine under Linux (Knoppix 9.3)
::crc::crc32 -file range.png
---> integer value too large to represent
# but when using a chunksize of 100000 instead of the default chunksize the result was correct.
# The file "range.png" had a size of 100,0 KiB
::crc::crc32 -file range.png -chunksize 100000
---> 1894110957
TWu - 2025-09-12 09:56:11
Thanks Uli for Your check!
The mentioned parameter "-chunksize" is not documented in Tcl version 8.6.4 and up. This parameter is documented only for cksum and sum. It is no good solution for really big files. One try to check is, if the same fails on using the pure Tcl implementation (so the error is in the critcl part of 9.0.x)? For this we can rename the tcllib-critcl folder to something else. By the way, my test files are only 4.1 kB in size.
Please see documentation under https://core.tcl-lang.org/tcllib/doc/205ddce17f/embedded/www/tcllib/files/modules/crc/crc32.html
Ticket: https://core.tcl-lang.org/tcllib/tktview/7bd2d439ca
Who is responsible to bring it forward?
TWu - 2025-09-24 13:52:17
With the reported error follows a not closing of the opened file.
So we get memory leaks and resource leaks too, which can sum up to critical case!