Check for buffer or string input at the javascript level before
passing the data down to C. Added tests for 3 out of the 4 detected
errors. (Need to figure out how to make the hashing function fail.)