from ouf import ByteChunk

def least_bytes(n, k = 1):
	mask = 256 ** k - 1
	return n & mask

class count:
	def __init__(self, start = 0, step = 1):
		self.__current = start - step
		self.__step    = step

	def __iter__(self):
		return self

	def next(self):
		self.__current += self.__step
		return self.__current

def boundaries(obj, start, length = None, end = None, n = 8):
		if not length == None:
			end = start + length

		return ByteChunk(obj[start-n:start+n]).split(n) + ByteChunk(obj[end-n:end+n]).split(n)