This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* HMAC tutorial | |
* | |
* Written by Devendra Naga ([email protected]) | |
* | |
* License MIT | |
*/ | |
#include <iostream> | |
#include <stdint.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Find current files in use for a specific process | |
* | |
* @Author: Devendra Naga ([email protected]) | |
* | |
* License MIT | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
struct linked_list { | |
void *data; | |
struct linked_list *next; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
class shared_data { | |
public: | |
~shared_data() { } | |
explicit shared_data(const shared_data &) = delete; | |
shared_data &operator=(const shared_data &) = delete; | |
// get shared object of this instance | |
static shared_data *get(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static shared_data *shared_data::get() | |
{ | |
static shared_data sh; | |
return &sh; | |
} | |
void shared_data::put_data(T &data) | |
{ | |
std::unique_lock<std::mnutex> lock(lock); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <mbedtls/hkdf.h> | |
#include <stdint.h> | |
#include <string.h> | |
// salt is shared between server and client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description GCD in C++ | |
* | |
* @copyright 2019-present Devendra Naga ([email protected]) All rights reserved | |
*/ | |
#include <iostream> | |
#include <memory> | |
#include <string> | |
#include <vector> | |
#include <thread> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* program to demonstrate wireless ioctl | |
*/ | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <math.h> | |
#include <net/if.h> | |
#include <sys/ioctl.h> | |
#include <linux/wireless.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <memory> | |
#include <vector> | |
#include <time.h> | |
#include <sys/time.h> | |
namespace Core_Middleware { | |
class Perf_Item { | |
public: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdint.h> | |
#include <string.h> | |
#include <openssl/pem.h> | |
#include <openssl/evp.h> | |
#include <openssl/ec.h> | |
class sm2_crypto { | |
public: | |
explicit sm2_crypto() { |