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

14
source/templates.ts Normal file
View File

@@ -0,0 +1,14 @@
import { binToHex, sha256, utf8ToBin, stringify } from '@bitauth/libauth';
import type { XOTemplate } from '@xo-cash/types';
/**
* Generates a deterministic template identifier by hashing the template.
*
* @param template - The template to generate an identifier for.
* @returns The template identifier for the template.
*/
export const generateTemplateIdentifier = (template: XOTemplate): string => {
// TODO: Finalize on the stringify method and ensure unique identifier generation is sufficient.
return binToHex(sha256.hash(utf8ToBin(stringify(template))));
};