Aggiunte le funzioni encode e decode
git-svn-id: svn://10.65.10.50/trunk@449 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8b82b498a5
commit
7f3881bc8e
@ -225,6 +225,28 @@ const char *esc(const char* s)
|
||||
return(__tmp_string);
|
||||
}
|
||||
|
||||
HIDDEN const char * const key = "QSECOFR-";
|
||||
|
||||
const char * encode( const char * data)
|
||||
{
|
||||
const int len = strlen(data);
|
||||
|
||||
for (int i = 0; i < len; i++)
|
||||
__tmp_string[i] = data[i] + (i < 8 ? key[i] : data[i - 8]);
|
||||
__tmp_string[i] = '\0';
|
||||
return __tmp_string;
|
||||
}
|
||||
|
||||
const char * decode( const char * data)
|
||||
{
|
||||
const int len = strlen(data);
|
||||
|
||||
for (int i = 0; i < len; i++)
|
||||
__tmp_string[i] = data[i] - (i < 8 ? key[i] : __tmp_string[i - 8]);
|
||||
__tmp_string[i] = '\0';
|
||||
return __tmp_string;
|
||||
}
|
||||
|
||||
#if XVT_OS == XVT_OS_SCOUNIX
|
||||
|
||||
int stricmp(const char* s1, const char* s2)
|
||||
|
@ -12,6 +12,8 @@ int rtoi(const char * roman);
|
||||
const char* itor(int i);
|
||||
bool fcopy(const char* orig, const char* dest);
|
||||
bool fexist(const char* file);
|
||||
const char * encode(const char * data);
|
||||
const char * decode(const char * data);
|
||||
|
||||
#if XVT_OS == XVT_OS_SCOUNIX
|
||||
int stricmp(const char*, const char*);
|
||||
|
Loading…
x
Reference in New Issue
Block a user