You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-10-30 07:25:34 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			42 lines
		
	
	
		
			710 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			710 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| // #include "my_global.h"
 | |
| /* Macros to make switching between C and C++ mode easier */
 | |
| #ifdef __cplusplus
 | |
| #define C_MODE_START \
 | |
|   extern "C"         \
 | |
|   {
 | |
| #define C_MODE_END }
 | |
| #else
 | |
| #define C_MODE_START
 | |
| #define C_MODE_END
 | |
| #endif
 | |
| #include "my_rnd.h"
 | |
| 
 | |
| namespace funcexp
 | |
| {
 | |
| class SQL_CRYPT
 | |
| {
 | |
|   struct my_rnd_struct rand, org_rand;
 | |
|   char decode_buff[256], encode_buff[256];
 | |
|   uint shift;
 | |
| 
 | |
|  public:
 | |
|   SQL_CRYPT() = default;
 | |
|   explicit SQL_CRYPT(ulong* seed)
 | |
|   {
 | |
|     init(seed);
 | |
|   }
 | |
|   ~SQL_CRYPT() = default;
 | |
|   void init(ulong* seed);
 | |
|   void reinit()
 | |
|   {
 | |
|     shift = 0;
 | |
|     rand = org_rand;
 | |
|   }
 | |
|   void encode(char* str, uint length);
 | |
|   void decode(char* str, uint length);
 | |
| };
 | |
| 
 | |
| }  // namespace funcexp
 |