The idea is to take a string and slip it up in to 2048 bytes.
So if i have a 5000 byte string. data.php returns how many chucks being 1 or more. data.php?chunk=1 returns the first 2048 bytes, chunk=2 returns the next 2048 bytes and chunk=3 returns the remaining 904 byes.
I’m not really sure how you would split it up by bytes.
Or is 1 character 1 byte?
I’m working with lsl which only allows 2048 bytes per request, that’s why i have to break it into chunks.
If the string is based on standard ASCII characters you can use simply use
As each character uses 1 byte , you essentially have 2048 characters covering 2048 bytes.
If you don’t want to do that you can also do it like this:
Edit:
My apologies, I misread 2048 bytes as 2048 bits and ended up calculating 256 characters. It was incorrect, as each character takes one byte, with 2048 bytes you have 2048 characters. I have fixed the codes above.