从 cocos2d-x引擎优化的一些建议,望引擎组重视 继续讨论:
在cocos2d-x中使用AES加密也分享出来: https://github.com/halx99/cocos2d-x-pc-port/tree/master/crypto-support
用法: 包含crypto_wrapper.h即可
// 复用内存方式:
std::string msg1 = “hello world, ok!”;
crypto::aes::overlapped::encrypt(msg1);
crypto::aes::overlapped::decrypt(msg2);
// 普通方式
std::string ciphertext = crypto::aes::encrypt(msg1);
std::string plaintext = crypto::aes::decrypt(ciphertext);