MCPcopy Index your code
hub / github.com/UI5/webcomponents / hexWrite

Function hexWrite

packages/main/test/pages/diffable-html.js:889–912  ·  view source on GitHub ↗
(buf, string, offset, length)

Source from the content-addressed store, hash-verified

887 }
888
889 function hexWrite (buf, string, offset, length) {
890 offset = Number(offset) || 0
891 var remaining = buf.length - offset
892 if (!length) {
893 length = remaining
894 } else {
895 length = Number(length)
896 if (length > remaining) {
897 length = remaining
898 }
899 }
900
901 var strLen = string.length
902
903 if (length > strLen / 2) {
904 length = strLen / 2
905 }
906 for (var i = 0; i < length; ++i) {
907 var parsed = parseInt(string.substr(i * 2, 2), 16)
908 if (numberIsNaN(parsed)) return i
909 buf[offset + i] = parsed
910 }
911 return i
912 }
913
914 function utf8Write (buf, string, offset, length) {
915 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)

Callers 1

diffable-html.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…