MCPcopy Index your code
hub / github.com/nodejs/node / createFromString

Function createFromString

lib/buffer.js:506–510  ·  view source on GitHub ↗
(string, ops, length = ops.byteLength(string))

Source from the content-addressed store, hash-verified

504}
505
506function createFromString(string, ops, length = ops.byteLength(string)) {
507 const buf = Buffer.allocUnsafeSlow(length);
508 const actual = ops.write(buf, string, 0, length);
509 return actual < length ? new FastBuffer(buf.buffer, 0, actual) : buf;
510}
511
512function fromString(string, encoding) {
513 let ops;

Callers 1

fromStringFastFunction · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…