Chore/base configurations

This commit is contained in:
Kuldeep
2026-01-25 12:51:34 +00:00
parent 6d3c0b3188
commit e8252b2fa2
21 changed files with 18154 additions and 1728 deletions

13
source/script.ts Normal file
View File

@@ -0,0 +1,13 @@
import { binToHex, sha256 } from '@bitauth/libauth';
/**
* Converts a script to a scriptHash.
* @param {Uint8Array} script - The script to convert.
* @returns {string} The scriptHash as a hexadecimal string.
*/
export const scriptToScriptHash = (script: Uint8Array): string => {
const hash = sha256.hash(script);
const reversed = hash.reverse();
return binToHex(reversed);
};