(buf, string, offset, length)
| 113383 | return bidirectionalIndexOf(this, val, byteOffset, encoding, false); |
| 113384 | }; |
| 113385 | function hexWrite(buf, string, offset, length) { |
| 113386 | offset = Number(offset) || 0; |
| 113387 | var remaining = buf.length - offset; |
| 113388 | if (!length) length = remaining; |
| 113389 | else { |
| 113390 | length = Number(length); |
| 113391 | if (length > remaining) length = remaining; |
| 113392 | } |
| 113393 | var strLen = string.length; |
| 113394 | if (length > strLen / 2) length = strLen / 2; |
| 113395 | for(var i = 0; i < length; ++i){ |
| 113396 | var parsed = parseInt(string.substr(i * 2, 2), 16); |
| 113397 | if (numberIsNaN(parsed)) return i; |
| 113398 | buf[offset + i] = parsed; |
| 113399 | } |
| 113400 | return i; |
| 113401 | } |
| 113402 | function utf8Write(buf, string, offset, length) { |
| 113403 | return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); |
| 113404 | } |
no test coverage detected