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:
@@ -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");
|
||||
|
||||
|
||||
@@ -15,18 +15,23 @@ formatSource(
|
||||
|
||||
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");
|
||||
|
||||
|
||||
@@ -76,6 +76,18 @@ code {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
details figure {
|
||||
margin: 1rem .5rem;
|
||||
}
|
||||
|
||||
details figure pre {
|
||||
overflow: auto;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
details[open] summary ~ * {
|
||||
animation: riseInDetails .5s ease-in-out;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
@@ -110,6 +122,15 @@ pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
select {
|
||||
background-color: var(--fg-light);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
select:open {
|
||||
background-color: var(--link-active);
|
||||
}
|
||||
|
||||
textarea {
|
||||
background-color: var(--fg-light);
|
||||
font-size: 1rem;
|
||||
@@ -117,21 +138,6 @@ textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
details figure {
|
||||
margin: 1rem .5rem;
|
||||
}
|
||||
|
||||
details figure pre {
|
||||
overflow: auto;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
|
||||
details[open] summary ~ * {
|
||||
animation: riseInDetails .5s ease-in-out;
|
||||
}
|
||||
|
||||
summary {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user