Added the capability for custom encryption's to be added to EHC.
This commit is contained in:
76
src/io/socket/ehc/NetEnc.cpp
Normal file
76
src/io/socket/ehc/NetEnc.cpp
Normal file
@@ -0,0 +1,76 @@
|
||||
#include "ehs/io/socket/ehc/NetEnc.h"
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
NetEnc::NetEnc()
|
||||
: owner(nullptr), hashId(0)
|
||||
{
|
||||
}
|
||||
|
||||
NetEnc::NetEnc(Str_8 id)
|
||||
: owner(nullptr), hashId(id.Hash_64()), id((Str_8 &&)id)
|
||||
{
|
||||
}
|
||||
|
||||
NetEnc::NetEnc(NetEnc&& enc) noexcept
|
||||
: owner(enc.owner), hashId(enc.hashId), id((Str_8 &&)enc.id)
|
||||
{
|
||||
enc.owner = nullptr;
|
||||
enc.hashId = 0;
|
||||
}
|
||||
|
||||
NetEnc::NetEnc(const NetEnc& enc)
|
||||
: owner(nullptr), hashId(enc.hashId), id(enc.id)
|
||||
{
|
||||
}
|
||||
|
||||
NetEnc& NetEnc::operator=(NetEnc&& enc) noexcept
|
||||
{
|
||||
if (this == &enc)
|
||||
return *this;
|
||||
|
||||
owner = enc.owner;
|
||||
hashId = enc.hashId;
|
||||
id = (Str_8 &&)enc.id;
|
||||
|
||||
enc.owner = nullptr;
|
||||
enc.hashId = 0;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
NetEnc& NetEnc::operator=(const NetEnc& enc)
|
||||
{
|
||||
if (this == &enc)
|
||||
return *this;
|
||||
|
||||
owner = nullptr;
|
||||
hashId = enc.hashId;
|
||||
id = enc.id;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
EHC* NetEnc::GetOwner() const
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
|
||||
UInt_64 NetEnc::GetHashId() const
|
||||
{
|
||||
return hashId;
|
||||
}
|
||||
|
||||
Str_8 NetEnc::GetId() const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
void NetEnc::Encrypt(Byte *data, UInt_64 size) const
|
||||
{
|
||||
}
|
||||
|
||||
void NetEnc::Decrypt(Byte *data, UInt_64 size) const
|
||||
{
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user