CRC function in misc.c

More
20 Nov 2018 14:09 - 20 Nov 2018 14:11 #71827 by csujun
CRC function in misc.c was created by csujun
I believe we don't really need Crc32 function here to do validation. Instead, all the callers to Crc are trying to get hash of a memory region and figure out if the content is changed when hash code is different. Or use Crc to compute a unique Id. So we only need a hash function here.

In content/language.c, there is an hash function fnv_16_str which is actual a 32bit hash function and fold result into 16bits.

Shall we move FNV hash functions to misc and replace the current Crc function to save couple of bytes (around 50 bytes).
github.com/howard0su/deviation/commit/0a...80f882f15ad9e49ee8bf

-Howard Su
Last edit: 20 Nov 2018 14:11 by csujun.

Please Log in or Create an account to join the conversation.

More
23 Nov 2018 21:50 #71863 by Moeder
Replied by Moeder on topic CRC function in misc.c
But fnv code isn't included in memory limited (devo 7e) builds, do those would actually be larger and not fitting anymore? I haven't looked at it explicitly, but Isn't the crc code a lot smaller than the fnv code?

Please Log in or Create an account to join the conversation.

More
23 Nov 2018 23:39 #71866 by csujun
Replied by csujun on topic CRC function in misc.c
You are right. I didn't realize devo7e didn't support multi language. fnv code is larger than crc32 code by 12 bytes.

Please Log in or Create an account to join the conversation.

Time to create page: 0.030 seconds
Powered by Kunena Forum