#!/usr/bin/python -OOOO # vim: set fileencoding=utf8 shiftwidth=4 tabstop=4 textwidth=80 foldmethod=marker : # Copyright (c) 2010, Kou Man Tong. All rights reserved. # For licensing, see LICENSE file included in the package. """ Base codec functions for bson. """ import struct import cStringIO # {{{ Private Logic def encode_string(value): length = len(value) return struct.pack("