MCPcopy Index your code
hub / github.com/plotly/plotly.js / hexWrite

Function hexWrite

stackgl_modules/index.js:730–751  ·  view source on GitHub ↗
(buf, string, offset, length)

Source from the content-addressed store, hash-verified

728 return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
729};
730function hexWrite(buf, string, offset, length) {
731 offset = Number(offset) || 0;
732 var remaining = buf.length - offset;
733 if (!length) {
734 length = remaining;
735 } else {
736 length = Number(length);
737 if (length > remaining) {
738 length = remaining;
739 }
740 }
741 var strLen = string.length;
742 if (length > strLen / 2) {
743 length = strLen / 2;
744 }
745 for (var i = 0; i < length; ++i) {
746 var parsed = parseInt(string.substr(i * 2, 2), 16);
747 if (numberIsNaN(parsed)) return i;
748 buf[offset + i] = parsed;
749 }
750 return i;
751}
752function utf8Write(buf, string, offset, length) {
753 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
754}

Callers 1

index.jsFile · 0.85

Calls 1

numberIsNaNFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…