js-xxhash icon indicating copy to clipboard operation
js-xxhash copied to clipboard

Error

Open dbudde opened this issue 7 years ago • 1 comments

When using 'xxhash.js' or 'xxhash.min.js', I am getting the following error:

Uncaught TypeError: input.copy is not a function [at XXH.update (xxhash.js:2205)]

I tried to debug it on my own initially, but I can't follow what the problem is. My call looks like this:

var seed = 32;
XXH.h32(inputString, seed).toString(16);

Please let me know if I can provide any other information.

dbudde avatar Aug 11 '17 14:08 dbudde

It looks like your input string is not detected as such: in the code, it checks for a native js string or arraybuffer otherwise it defaults to a node buffer object which has the copy method. Try converting your input to one of those first.

pierrec avatar Aug 27 '17 08:08 pierrec