function scriptToHash(script) {
  /** @type {Buffer} */
  const scriptHash = digest(Buffer.from(script, "hex")).reverse()
  return scriptHash.toString("hex")
}
/**
 * Converts ScriptPubKey to a script hash specified by the [Electrum Protocol](https://electrumx.readthedocs.io/en/stable/protocol-basics.html#script-hashes).
 * @param {string} script ScriptPubKey in a hexadecimal format.
 * @return {string} Script hash as a hex string.
 */
Converts ScriptPubKey to a script hash specified by the [Electrum Protocol].
@param {string} script ScriptPubKey in a hexadecimal format.
@return {string} Script hash as a hex string.
Converts ScriptPubKey to a script hash specified by the [ Electrum Protocol ] . @param { string } script ScriptPubKey in a hexadecimal format . @return { string } Script hash as a hex string .
function scriptToHash(script) {
  const scriptHash = digest(Buffer.from(script, "hex")).reverse()
  return scriptHash.toString("hex")
}
function scriptToHash ( script ) { const scriptHash = digest ( Buffer . from ( script , "hex" ) ) . reverse ( ) return scriptHash . toString ( "hex" ) }
Converts ScriptPubKey to a script hash specified by the [Electrum Protocol](https://electrumx.readthedocs.io/en/stable/protocol-basics.html#script-hashes).
Converts ScriptPubKey to a script hash specified by the [ Electrum Protocol ] ( https : // electrumx . readthedocs . io / en / stable / protocol - basics . html#script - hashes ) .
/** @type {Buffer} */