MCPcopy Create free account
hub / github.com/F-Stack/f-stack / getRandomHexChars

Function getRandomHexChars

app/redis-6.2.6/src/util.c:715–721  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

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. */
715void 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

Callers 8

sentinelIsRunningFunction · 0.85
changeReplicationIdFunction · 0.85
initServerConfigFunction · 0.85
rdbSaveRioWithEOFMarkFunction · 0.85
clusterResetFunction · 0.85
createClusterNodeFunction · 0.85
aclCommandFunction · 0.85
RM_GetRandomHexCharsFunction · 0.85

Calls 1

getRandomBytesFunction · 0.85

Tested by

no test coverage detected