| 1520 | /////////////////// misc helper functions //////////////////////////////////////////////////////////////// |
| 1521 | |
| 1522 | static const char *hashchunktoa(tiger::chunk h) // portable solution instead of printf("%llx") |
| 1523 | { // use next protocol bump to switch to hashstring() above! |
| 1524 | static string buf; |
| 1525 | static int bufidx; |
| 1526 | bufidx = (bufidx + 1) & 0x3; |
| 1527 | char *s = buf + (bufidx * 33) + 33; |
| 1528 | *s-- = '\0'; |
| 1529 | while(h) |
| 1530 | { |
| 1531 | *s-- = "0123456789abcdef"[h & 0xf]; |
| 1532 | h >>= 4; |
| 1533 | } |
| 1534 | return s + 1; |
| 1535 | } |
| 1536 | |
| 1537 | const char *genpwdhash(const char *name, const char *pwd, int salt) |
| 1538 | { |