Skip to content

Instantly share code, notes, and snippets.

View lnsp's full-sized avatar
👊

Lennart lnsp

👊
View GitHub Profile
@lnsp
lnsp / arcfour.c
Created July 14, 2015 18:23
a ARC4 encryption / decryption program
// ARC4 by Ronald L. Rivest
// Implementation by mooxmirror
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#define byte unsigned char
#define STDIN_BUFFER_SIZE 8
@lnsp
lnsp / crack.c
Created August 2, 2015 00:57
a cs50 hacker problem set
/*******************************************
** CS50X - Hacker 2 - crack.c **
** requires /usr/share/dict/words **
** (c) 2015 mooxmirror **
*******************************************/
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
@lnsp
lnsp / cree.py
Created August 2, 2015 01:06
super small and simple encryption / decryption library using sponge functions
# a super simple encryption / decryption library using sponge functions
# all credit for RC4 / Spritz goes to Ron Rivest / RSA
# Spritz implementation based on http://people.csail.mit.edu/rivest/pubs/RS14.pdf
import math
class RC4:
def initializeState(self):
self.i = self.j = 0
import java.io.IOException;
import java.io.FileReader;
import java.io.BufferedReader;
public class FileReaderDemo
{
private BufferedReader reader;
public void open(String path)
{
package io.mooxmirror.javakurs2;
public class HalloWelt {
public static void main(String[] args) {
System.out.println("Hallo Welt!");
;
System.out.println(13);
System.out.println("Und Ende!");
}
#!/usr/bin/python3
# (c) 2016 lsp
# /r/dailyprogrammer
def deoblique(matrix):
n = 0
for row in oblique:
p = min(n, size-1)
for i in range(len(row)):
matrix[n-p+i][p-i] = row[i]
public class BinarySearchTree<T extends Comparable> {
private class Node {
private T mContent;
private Node mLeft, mRight;
public Node(T content, Node left, Node right) {
mContent = content;
mLeft = left;
mRight = right;
from operator import itemgetter
def limit_search_space(space, pattern, bad_char):
# _ for unknown character
index = 0
# filter by symbols
for char in pattern:
if char != '_':
space = [word for word in space if word[index] == char]
else:

Keybase proof

I hereby claim:

  • I am lnsp on github.
  • I am lnsp (https://keybase.io/lnsp) on keybase.
  • I have a public key ASBO53YtumwG7-tVjKeQ-dSlwFnhHitmYCGNAI9K2D_1zAo

To claim this, I am signing this object:

public class Programm {
public static void main(String[] args) {
byte rang = 1;
short freunde = 2000;
int alter = 36;
long gehalt = 300000000;
double guthaben = 3.14;
float chance = 25.4235f;
char geschlecht = 'm';
boolean lebend = true;