plotnikoff / vcdiff.js

VCDiff implementation in javascript (partially compliant with RFC 3284)
52 stars 6 forks source link

Correct subtraction of the leading value in nextHash #2

Closed aprescott closed 13 years ago

aprescott commented 13 years ago

The subtraction should be firstCharCodeValue * Math.pow(base, lastPower), instead of firstCharCodeValue * lastPower.

aprescott commented 13 years ago

Just to clarify, this makes hash("ab"); nextHash("c"); come out the same as hash("bc");, as desired.

aprescott commented 13 years ago

I clearly didn't read closely enough, as lastPower is in fact the computed value. Sorry for the noise.