Skip to content

Instantly share code, notes, and snippets.

View adammenges's full-sized avatar
💚
Lobe

Adam Menges adammenges

💚
Lobe
View GitHub Profile
require 'msf/core'
require 'crypt/blowfish' # sorry, openssl is limited to 16-byte key size :(
# add gem 'crypt', '1.1.4' to Gemfile
module ::Crypt
class Blowfish
def setup_blowfish()
@sBoxes = Array.new(4) { |i| INITIALSBOXES[i].clone }
@pArray = INITIALPARRAY.clone
keypos = 0
from collections import defaultdict
def isUnique(string):
seen = defaultdict(lambda: False)
for x in string:
if not seen[x]: seen[x] = True
else: return False
return True
@adammenges
adammenges / fib.py
Created March 17, 2014 22:54
nth fib
def fib(n):
return reduce(lambda x, y: [x[1], x[0] + x[1]], xrange(n-2), [0, 1])[1]