MCPcopy
hub / github.com/bcoin-org/bcoin / fromString

Method fromString

lib/script/opcode.js:483–487  ·  view source on GitHub ↗

* Instantiate a pushdata opcode from a string. * @param {String} str * @param {String} [enc=utf8] * @returns {Opcode}

(str, enc)

Source from the content-addressed store, hash-verified

481 */
482
483 static fromString(str, enc) {
484 assert(typeof str === 'string');
485 const data = Buffer.from(str, enc || 'utf8');
486 return this.fromData(data);
487 }
488
489 /**
490 * Instantiate an opcode from a small number.

Callers

nothing calls this directly

Calls 2

fromDataMethod · 0.95
fromMethod · 0.80

Tested by

no test coverage detected