18 lines
622 B
C++
18 lines
622 B
C++
#include "SessionId.h"
|
|
#include <openssl/ssl.h>
|
|
|
|
namespace jet {
|
|
|
|
SessionId::SessionId() {
|
|
unsigned char hashit[64];
|
|
unsigned char hash[SHA_DIGEST_LENGTH];
|
|
setSize(64);
|
|
sprintf((char *)hashit, "JETSESSION%ld", time(0));
|
|
SHA1(hashit, strlen((char *)hashit), hash);
|
|
sprintf(getData(), "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
|
hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7], hash[8], hash[9],
|
|
hash[10], hash[11], hash[12], hash[13], hash[14], hash[15], hash[16], hash[17], hash[18], hash[19]);
|
|
}
|
|
|
|
}
|