19 lines
333 B
C
Raw Normal View History

2021-10-23 16:28:57 +08:00
//
// Created by YuhangQ on 2021/10/23.
//
#ifndef INVODB_UUID_H
#define INVODB_UUID_H
#include <iostream>
#include <string>
2021-10-25 22:07:18 +08:00
inline void generateUUID(char *uuid) {
2021-10-24 14:08:12 +08:00
for(int i=0; i<32; i++) {
int randn = rand() % 36;
2021-10-24 20:21:04 +08:00
uuid[i] = (randn < 26 ? ('a' + randn) : ('0' + (randn - 26)));
2021-10-24 14:08:12 +08:00
}
2021-10-23 16:28:57 +08:00
}
#endif //INVODB_UUID_H