Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _GNU_SOURCE
- #include <stdio.h>
- #include <string.h>
- #include <stdint.h>
- uint32_t djb2(const char *str)
- {
- uint32_t hash = 5381;
- int c;
- while ((c = *str++))
- hash = hash * 33 + c;
- return hash;
- }
- int main(void)
- {
- char s[] = "codroipo ";
- while (djb2(s) != 0xd07f3c4 && djb2(s) != 0x8f62f044) {
- strfry(s);
- puts(s);
- }
- return 0;
- }
Advertisement