Skip to content

Instantly share code, notes, and snippets.

View hoiogi's full-sized avatar

Jeong ChangWook hoiogi

  • NCSOFT
  • Korea, Republic of
View GitHub Profile
def printPyramid(num):
data = list(range(1, num)) + list(range(num, 0, -1))
for i in data:
result = ' ' * (i-1)
if i == 1:
result += ''.join(str(x) for x in data)
else:
result += ''.join(str(x) for x in data[i-1:-i+1])
print(result)
@hoiogi
hoiogi / RC4.cs
Created March 7, 2016 08:46
C# RC4 Sample
public class RC4 {
public static byte[] Encrypt(byte[] pwd, byte[] data) {
int a, i, j, k, tmp;
int[] key, box;
byte[] cipher;
key = new int[256];
box = new int[256];
cipher = new byte[data.Length];