Make test data match ('123456789abcdef' * 16) in python
Check buffer length before slicing

Node versions < 0.10 will throw an out of bounds error when slicing
beyond the end of a buffer. Add a guard to default to length of the
buffer in this case.