qb-utf8-compare
v1.0.2
Published
qb-utf8-compare
Downloads
293
Maintainers
Readme
qb-utf8-compare
Compare selections of UTF8 bytes directly and without creating javascript strings.
This is significantly more efficient than using strings for long or large numbers of buffer selections.
Complies with the 100% test coverage and minimum dependency requirements of qb-standard .
Install:
npm install qb-utf8-compare
Usage
compare( src1, off1, lim1,src2, off2, lim2 )
Compare code points of two byte ranges holding UTF8-encoded data. The function works similarly to the sort comparator in javascript.
return
1 if src1 selection is greater
-1 if src2 selection is greater
0 if selections are equal