Toggle menu
68
66
13
4496
1F616EMO Survival Server Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 12:11, 14 January 2025 by 1F616EMO (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:Crc32lua

CRC32的純Lua實現。

補充:Scribunto提供的標準庫中,提供了mw.hash.hashValue()可以用於生成散列值,其實際上是調用PHPhash()方法,其中PHP的hash支持算法中,包括三個crc32,分別是crc32、crc32b、crc32c;本lua模塊實現的對應就是前面的crc32b,其輸出值是前述調用輸出字節原值的十進制值(即mw.hash.hashValue()字節原值的十六進制值)。所以如有性能需要且入參為字符串的話,可以考慮用Scribunto提供的基礎庫實現代替(標準庫提供的只支持字符串入參,不支持字節串入參,儘管PHP的實現是支持的)。