Generate the Redis "Run ID", a SHA1-sized random number that identifies a * given execution of Redis, so that if you are talking with an instance * having run_id == A, and you reconnect and it has run_id == B, you can be * sure that it is either a different instance or it was restarted. */
| 713 | * having run_id == A, and you reconnect and it has run_id == B, you can be |
| 714 | * sure that it is either a different instance or it was restarted. */ |
| 715 | void getRandomHexChars(char *p, size_t len) { |
| 716 | char *charset = "0123456789abcdef"; |
| 717 | size_t j; |
| 718 | |
| 719 | getRandomBytes((unsigned char*)p,len); |
| 720 | for (j = 0; j < len; j++) p[j] = charset[p[j] & 0x0F]; |
| 721 | } |
| 722 | |
| 723 | /* Given the filename, return the absolute path as an SDS string, or NULL |
| 724 | * if it fails for some reason. Note that "filename" may be an absolute path |
no test coverage detected