add support for v2 hashing algorithm.

update README.md and demo file to be more in sync.
update to v0.10.0.
This commit is contained in:
2026-03-29 22:34:43 -04:00
parent d5363c3960
commit c776b5df6a
33 changed files with 2255 additions and 1524 deletions

View File

@@ -9,17 +9,22 @@ formHash.addEventListener("submit", (e) => {
e.preventDefault();
const content = formHash.elements["content"].value;
const created = formHash.elements["created"].value;
const version = parseInt(formHash.elements["version"].value, 10);
const url = formHash.elements["url"].value;
const hash = hashTwt({
content,
created,
url,
});
const hash = hashTwt(
{
content,
created,
url,
},
version,
);
const result = [
`content: ${content}`,
`created: ${created}`,
`url: ${url}`,
`version: ${version}`,
`hash: ${hash}`,
].join("\n");