Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] Calculating CRC-32 in AGK

Author
Message
YesItsASpoon
9
Years of Service
User Offline
Joined: 3rd Feb 2015
Location: Southern California
Posted: 7th Oct 2019 16:37
Does anyone know of an easy way to calculate a CRC-32 within AppGameKit Studio?

I use Tier 1. I'm looking to do this without using an online calculator, so that the process is completely internal & offline. I've found some general guides + sample code in other languages, but I'm having a hard time wrapping my head around what's actually going on with the process.

The author of this post has marked a post as an answer.

Go to answer

Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 7th Oct 2019 18:55
This post has been marked by the post author as the answer.
Theres no built in function to do it (i dont think? ) but its pretty easy to just write one...



It produces answers that agree with the online converters so i think its right.
Getafix
6
Years of Service
User Offline
Joined: 14th Apr 2017
Location:
Posted: 7th Oct 2019 19:04
Hi - I concur, the output and function is correct. You could just put the table in pre-calculated.

Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 7th Oct 2019 19:13
Indeed, good point! You could put the precompiled table in, but...

1) even on my 9 year old laptop it takes 600uS to generate the table and thats done just once at the beginning
2) It makes the bytecode smaller to compute it
3) if you want to change your polynomial then you will need a new table where as a one line change and it just works.

Precompute is nice but 50-50 as to whether its worth it. i dont like long tables in code personally but thats just me
YesItsASpoon
9
Years of Service
User Offline
Joined: 3rd Feb 2015
Location: Southern California
Posted: 7th Oct 2019 19:16
This is fantastic! Thank you so much!

Login to post a reply

Server time is: 2024-03-28 13:41:44
Your offset time is: 2024-03-28 13:41:44