qb-utf8-compare

1.0.2 • Public • Published

qb-utf8-compare

npm downloads dependencies dev dependencies code analysis

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

Package Sidebar

Install

npm i qb-utf8-compare

Weekly Downloads

114

Version

1.0.2

License

ISC

Unpacked Size

6.46 kB

Total Files

4

Last publish

Collaborators

  • mvoss9000