from what i’de gathered it literally just seems like a math library but theirs more i just know it
now bit32 is a entire library yet i can’t find any practicality out of it all it seems to do is take another number and spit out a value based on said number. theirs so many builtin functions yet they all do similar things. yeah i know it’s a very niche library but why does this even exist. i’ve never came across code using even a single builtin from the bit32 library. what is their to know?. sometimes it will spit out encoded strings that looks like a URL a table id or even Jason data?. maybe it’s used for working with custom made API? keys or exported data from external sites
bit32.bxor(NUMBER) – Prints out the number you put in OMG no way THIS IS SO insanely useful. guys totally won’t ever use this
bit32.rshift(4,80) - OMG it prints zero regardless of number 1 and 2 this is ground breaking totally
i could be wrong but the amount of builtin seemed to double for bit32 over the last 1.5 years they must have started adding alot of new builtins. So it has to be useful or does it…
whats a bitwise operation anyways
The bit32 library provides functions to perform bitwise operations. Bitwise operations manipulate individual bits of binary numbers. These operations are commonly used in low-level programming and can be useful in certain scenarios
Here are some key functions provided by the bit32 library:
-
bit32.band: Returns the bitwise AND of its operands. This function performs a logical AND operation on each corresponding pair of bits in the operands.
-
bit32.bor: Returns the bitwise OR of its operands. This function performs a logical OR operation on each corresponding pair of bits in the operands.
-
bit32.bnot: Returns the bitwise negation of a given number. This function flips all the bits in the number, changing 0s to 1s and 1s to 0s.
-
bit32.bxor: Returns the bitwise XOR of its operands. This function performs a logical XOR operation on each corresponding pair of bits in the operands.
-
bit32.arshift: Returns a number after its bits have been arithmetically shifted to the right by a given displacement. This shift operation is what is called an arithmetic shift. Vacant bits on the left are filled with copies of the higher bit of the number, and vacant bits on the right are filled with zeros.
Didn’t really help to much but I appreciate you going out of your way to try help me. Have a good day!