5 #define NPL_PRIVATE_KEY_SIZE 64 25 static int Encode(
char* dest,
const char* src,
int nSrcSize, uint32 nPublicKey = 0);
35 static int Decode(
char* dest,
const char* src,
int nSrcSize, uint32 nPublicKey = 0);
65 static int Compress(
string& outstring,
const char* src,
int nSrcSize,
int compressionlevel = -1);
73 static int Decompress(
string& outstring,
const char* src,
int nSrcSize);
75 static byte m_sPrivateKey[NPL_PRIVATE_KEY_SIZE+4];
define this to enable debugging of NPL code in visual studio
Definition: INPL.h:9
transport layer NPL message compressor(encoder) and decompresser(decoder) Currently, we use a very simply custom encoding/decoding algorithm.
Definition: NPLCodec.h:14
static int Decompress(string &outstring, const char *src, int nSrcSize)
Decompress src to destination.
Definition: NPLCodec.cpp:151
static int Encode(char *dest, const char *src, int nSrcSize, uint32 nPublicKey=0)
encode a byte array from src to dest
Definition: NPLCodec.cpp:45
static int Decode(char *dest, const char *src, int nSrcSize, uint32 nPublicKey=0)
decode a byte array from src to dest
Definition: NPLCodec.cpp:29
static void SetGenericKey(const byte *sKey, int nSize)
set the generic key that is used for encoding/decoding.
Definition: NPLCodec.cpp:89
static int Compress(string &outstring, const char *src, int nSrcSize, int compressionlevel=-1)
Compress src to a string buffer using zlib.
Definition: NPLCodec.cpp:111
static void UsePlainTextEncoding(bool bUsePlainTextEncoding)
no matter what public key is used, we will ensure that the encoded message is plain text [0...
Definition: NPLCodec.cpp:61