Created
December 11, 2013 08:15
-
-
Save aristote/7906718 to your computer and use it in GitHub Desktop.
Gist test with crappy code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int charToInt32(char * clearText, char * int32result[]) | |
{ | |
int i = 0, j = 0, pos = 0, clearSize; | |
int dec[4] = {24, 16, 8, 0}; | |
unsigned int valeurRetour = 0; | |
printf(">> 1\n"); | |
clearSize = strlen(clearText); | |
int32result = realloc(int32result, sizeof(int)*(clearSize+1)); | |
for (i=0; i<clearSize; i+=4) { | |
valeurRetour = 0; | |
pos++; | |
for (j=0; j <= 3 ; j++) | |
valeurRetour |= (unsigned int)(clearText[i+j] << dec[j]) ; | |
//printf("%u\n", valeurRetour); | |
sprintf(int32result[pos], "%d", valeurRetour,15); | |
} | |
return pos; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment