Friday, June 05, 2009

The GIGO Buffer

I've contemplated doing this for a while, and after a conversation at work this past week, I've decided to actually implement it.

Presenting, a GIGO (Garbage In, Garbage Out) Buffer. Implemented in Python, and won't work on Windows (because really, that whole OS is basically a giant GIGO buffer).


#!/usr/bin/env python

class GIGO_Buffer:
"""
Implementation of a Garbage In, Garbage Out buffer.
"""

def push(self, element):
"""
Push data into the buffer.

@param element: Data to add to the buffer.
"""
return

def pop(self, len):
"""
Pop data from the buffer.

@param len: Number of bytes of data to pop from the buffer.
@returns len bytes of data from the buffer.
"""
data = open('/dev/urandom', 'r')
rval = data.read(len)
data.close()
return rval

No comments: