Let's say I have the following char array
char array[32];
I want to use only the 10 most significant bits of this array as a hash value.
Is it possible to use bitwise operation on this char array?
If so, how should i do it?
Let's say I have the following char array
char array[32];
I want to use only the 10 most significant bits of this array as a hash value.
Is it possible to use bitwise operation on this char array?
If so, how should i do it?
I'm pretty sure you want something like this (again assuming 8-bit
char
s stored big endian inarray
):To break that down a bit:
Assuming your implementation has 8-bit
char
, and that you have a 256-bit number stored in big endian in this array, here how to access the 10 msb of the 256-bit number.