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

Bug in BodyHashOfENMLHash?

Open sumitrshah opened this issue 11 years ago • 1 comments

Hi,

Thanks for your good work on this module.

I think there may be a bug in the function converting the hexadecimal hash for a resource to a binary hash. It doesn't seem to work properly for me when I create a map of the binary hash to the resource URL.

My workaround has been to:

(1) convert the binary hash received from the Evernote API (using the Evernote Node library) to a hex string by using the Node Buffer class << new Buffer(resource.data.bodyHash).toString('hex') >>;

(2) map the hex hash to the resource URL (instead of the binary hash); and

(3) comment out line 157, which runs the BodyHashOfENMLHash function on the hex hash pulled from the ENML

You might want to take a look at the hex hash to binary hash helper function and see if there's something there causing problems.

Thanks.

sumitrshah avatar Jan 24 '14 04:01 sumitrshah

Hello, sorry for taking really long time to response to the problem.

The thing is I wrote this library before the Evernote's official javascript SDK came out. And most people, at the time, didn't use Uint8Array to handle binary fields (instead, we used normal String).

I think it's time to rewrite the library to work with the official SDK. Give me a weekend to do it.

wanasit avatar Feb 20 '14 13:02 wanasit