View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0031444||Runner||Functions||Public||2019-10-17 17:59||2019-10-18 14:53|
|Platform||Windows||OS||Windows 10 Pro||OS Version||>=18362|
|Target Version||Fixed in Version|
|Summary||0031444: Functions: introduce buffer_crc32(buffer, offset, size)|
|Description||As CRC32 is very commonly used in file formats and protocols, it would seem like a reasonable thing to introduce a built-in function for it, as re-implementing the algorithm in GML loses the speed advantage that it's usually chosen for to begin with.|
The function would work much like the existing buffer_sha1(buffer, offset, size) and buffer_md5(buffer, offset, size);
The runtimes already contain a CRC32 implementation.
Introduce a buffer_crc32(buffer, offset, size) function to compute a CRC32 hash of a buffer section.
Why do we want this feature
CRC32 is very commonly used in file formats and protocols; re-implementing the algorithm in GML loses the speed advantage that it's usually chosen for; common optimization methods (multi-byte operations with pre-computed tables) are not very effective at mitigating the overhead.
buffer_crc32(buffer, offset, size)
Other buffer hash functions don't have DnD blocks so this one probably doesn't need to either
(pretty much the same as existing buffer_sha1/buffer_md5 pages)
|1.4 Found In|
|2.x Runtime Found In|
|2.x Runtime Verified In|