Skip to content

Instantly share code, notes, and snippets.

View wongoo's full-sized avatar
💭
I may be slow to respond.

望哥 wongoo

💭
I may be slow to respond.
  • homeking
  • Xiamen, Fujian, China
View GitHub Profile
@bricef
bricef / AES.c
Last active May 11, 2024 21:15
A simple example of using AES encryption in Java and C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>
@mythosil
mythosil / bufferevent_echo_server.c
Created August 31, 2011 09:42
echo server using bufferevent(libevent)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <event2/event.h>
#include <event2/bufferevent.h>
#define PORT 1986
#define BACKLOG 1000
void readcb(struct bufferevent *bufev, void *arg)
@mythosil
mythosil / libevent_test.c
Created August 6, 2011 09:51
libevent sample (echo server)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <event.h>
#define PORT 1986
#define BACKLOG -1
#define BUFSIZE 256