diff --git a/scripts/sync.mjs b/scripts/sync.mjs index ec801b4..446eee3 100644 --- a/scripts/sync.mjs +++ b/scripts/sync.mjs @@ -19,6 +19,10 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { marked } from 'marked'; import { collections, projects, site } from '../projects.config.mjs'; +import { linkRfcsInMarkdown, markedRfc } from '../src/lib/rfc.mjs'; + +// Every RFC mention links to the Datatracker, in all HTML built here. +marked.use(markedRfc); const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); const cacheDir = path.join(root, '.cache', 'repos'); @@ -182,7 +186,7 @@ function rewriteLinks(md, ctx) { if (isImage) return `https://raw.githubusercontent.com/${repo}/${branch}/${resolved}`; return `https://github.com/${repo}/blob/${branch}/${resolved}${hash ? `#${hash}` : ''}`; }; - return md + return linkRfcsInMarkdown(md) .replace(/(!?)\[([^\]]*)\]\(\s*]+)>?(\s+"[^"]*")?\s*\)/g, (m, bang, text, url, title = '') => `${bang}[${text}](${fix(url, !!bang)}${title})`, ) diff --git a/src/components/RfcText.astro b/src/components/RfcText.astro new file mode 100644 index 0000000..85d94d7 --- /dev/null +++ b/src/components/RfcText.astro @@ -0,0 +1,11 @@ +--- +// Renders a plain string with every RFC mention linked to the Datatracker. +import { rfcParts } from '../lib/rfc.mjs'; + +interface Props { + text: string; +} +const parts = rfcParts(Astro.props.text); +--- + +{parts.map((p) => (typeof p === 'string' ? p : {p.text}))} diff --git a/src/components/toolbox/Aes.astro b/src/components/toolbox/Aes.astro new file mode 100644 index 0000000..ed77441 --- /dev/null +++ b/src/components/toolbox/Aes.astro @@ -0,0 +1,203 @@ +--- +// AES in the classic modes. GCM lives on the "Encrypt and decrypt" tool. +const modes = [ + ['cbc', 'CBC'], + ['ctr', 'CTR'], + ['ecb', 'ECB'], + ['cfb', 'CFB (128-bit)'], + ['cfb8', 'CFB8'], + ['ofb', 'OFB'], + ['ccm', 'CCM (authenticated)'], + ['xts', 'XTS (disk encryption)'], + ['pcbc', 'PCBC'], + ['ige', 'IGE'], +]; +const paddings = [ + ['pkcs7', 'PKCS#7'], + ['ansi', 'ANSI X9.23'], + ['byte', 'ISO/IEC 7816-4'], + ['zero', 'Zero bytes'], + ['none', 'None'], +]; +--- + +
+
+
+ + +
+
+ + +
+ +
+

+ +
+
+ + +
+ +

+
+
+
+ + +
+ +

+
+ + +
+ + +
+ +
+
+
+ + +
+ +
+
+ +
+ + +
+
+ + +
+
+ + diff --git a/src/components/toolbox/Codec.astro b/src/components/toolbox/Codec.astro index 1061b87..6832f50 100644 --- a/src/components/toolbox/Codec.astro +++ b/src/components/toolbox/Codec.astro @@ -34,6 +34,9 @@ const LABELS: Record = { base62: 'Base62', base36: 'Base36', base45: 'Base45', + percent: 'Percent-encoded (RFC 3986)', + 'percent-component': 'Like encodeURIComponent', + 'percent-form': 'Form data (space as +)', }; --- diff --git a/src/components/toolbox/Hash.astro b/src/components/toolbox/Hash.astro index 893f617..070eb33 100644 --- a/src/components/toolbox/Hash.astro +++ b/src/components/toolbox/Hash.astro @@ -46,7 +46,13 @@ const { ids, common } = Astro.props;
- +
+ + +
diff --git a/src/components/toolbox/Totp.astro b/src/components/toolbox/Totp.astro index 6e4e065..d3173dd 100644 --- a/src/components/toolbox/Totp.astro +++ b/src/components/toolbox/Totp.astro @@ -4,6 +4,10 @@ ---
+
+ + +
@@ -28,14 +32,19 @@
-
+ +
-
+ +

Current code

@@ -53,7 +62,7 @@
diff --git a/src/lib/rfc.mjs b/src/lib/rfc.mjs new file mode 100644 index 0000000..8095660 --- /dev/null +++ b/src/lib/rfc.mjs @@ -0,0 +1,86 @@ +// Links every "RFC 1234" / "RFC-1234" / "RFC1234" mention to the RFC on the +// IETF Datatracker. Used three ways so library repos need no changes: +// - linkRfcsInMarkdown: Markdown pages that scripts/sync.mjs writes, +// - markedRfc: HTML that scripts/sync.mjs renders with marked, +// - rfcParts: plain strings in Astro pages (see components/RfcText.astro). +// Text already inside a link, inline code or a code block is left alone. + +const RFC = /\bRFC[- ]?(\d{3,5})\b/g; + +/** @param {number | string} n */ +export const rfcUrl = (n) => `https://datatracker.ietf.org/doc/html/rfc${Number(n)}`; + +/** + * Splits text into plain strings and RFC links. + * @param {string} text + * @returns {(string | { text: string, href: string })[]} + */ +export function rfcParts(text) { + const out = []; + let last = 0; + for (const m of text.matchAll(RFC)) { + if (m.index > last) out.push(text.slice(last, m.index)); + out.push({ text: m[0], href: rfcUrl(m[1]) }); + last = m.index + m[0].length; + } + if (last < text.length) out.push(text.slice(last)); + return out; +} + +// Pieces of a Markdown line that must not be touched: inline code, links and +// images, reference links, HTML links and tags, bare URLs. +const PROTECTED = /]*>.*?<\/a>|`+[^`]*`+|!?\[[^\]]*\](?:\([^)]*\)|\[[^\]]*\])?|<[^>]+>|https?:\/\/\S+/g; + +/** + * Turns RFC mentions in Markdown source into Markdown links. Skips fenced code + * blocks, reference definitions and everything PROTECTED matches. + * @param {string} md + */ +export function linkRfcsInMarkdown(md) { + let fence = ''; + return md + .split('\n') + .map((line) => { + const f = /^\s*(`{3,}|~{3,})/.exec(line); + if (f) { + if (!fence) fence = f[1][0]; + else if (f[1][0] === fence) fence = ''; + return line; + } + if (fence || /^\s*\[[^\]]+\]:/.test(line) || /^( {4}|\t)/.test(line)) return line; + let out = ''; + let last = 0; + const link = (t) => t.replace(RFC, (m, n) => `[${m}](${rfcUrl(n)})`); + for (const m of line.matchAll(PROTECTED)) { + out += link(line.slice(last, m.index)) + m[0]; + last = m.index + m[0].length; + } + return out + link(line.slice(last)); + }) + .join('\n'); +} + +/** marked extension: an inline token for RFC mentions outside links. */ +export const markedRfc = { + extensions: [ + { + name: 'rfc', + level: 'inline', + /** @param {string} src */ + start(src) { + const m = /RFC[- ]?\d/.exec(src); + return m ? m.index : undefined; + }, + /** @this {any} @param {string} src */ + tokenizer(src) { + if (this.lexer.state.inLink) return undefined; + const m = /^RFC[- ]?(\d{3,5})\b/.exec(src); + return m ? { type: 'rfc', raw: m[0], n: m[1] } : undefined; + }, + /** @param {any} token */ + renderer(token) { + return `${token.raw}`; + }, + }, + ], +}; diff --git a/src/lib/toolbox-copy.ts b/src/lib/toolbox-copy.ts index b53f7f2..0972aa2 100644 --- a/src/lib/toolbox-copy.ts +++ b/src/lib/toolbox-copy.ts @@ -26,7 +26,7 @@ export const toolCopy: Record = { title: 'SHA-256, SHA-3 and MD5 hash generator', about: [ 'A hash function turns any input into a short, fixed-size digest. The same input always gives the same digest, and changing one byte changes it completely. Hashes are used to check downloads, spot changed files, and build signatures and identifiers.', - 'Type text or drop in a file of up to 256 MB, and this page shows its digest under every supported algorithm at once: SHA-256, SHA-512, SHA-3, BLAKE2, Keccak-256, RIPEMD-160, SM3, SHA-1, MD5 and more. Input can be UTF-8 text, hex or Base64, and digests are shown in lowercase hex, uppercase hex or Base64.', + 'Type text or drop in a file of up to 256 MB, and this page shows its digest under every supported algorithm at once: SHA-256, SHA-512, SHA-3, BLAKE2, Keccak-256, RIPEMD-160, SM3, SHA-1, MD5 and more. Input can be UTF-8 text, hex or Base64, and digests are shown in lowercase hex, uppercase hex or Base64. Under “Show all algorithms” you can also set the output length of SHAKE128 and SHAKE256.', ], faq: [ { @@ -63,10 +63,10 @@ export const toolCopy: Record = { ], }, hmac: { - title: 'HMAC-SHA256 generator', + title: 'HMAC-SHA256 and keyed BLAKE2 generator', about: [ 'An HMAC is a hash of a message mixed with a secret key. Anyone holding the key can recompute it to check that the message came from someone else with the key and was not changed. Webhooks, API request signing and session cookies commonly use HMAC-SHA256.', - 'Enter a key and a message as text, hex or Base64, pick the hash, and read the HMAC in hex, Base64 or Base64URL.', + 'Enter a key and a message as text, hex or Base64, pick the hash, and read the HMAC in hex, Base64 or Base64URL. BLAKE2 also has its own keyed mode, defined in RFC 7693, which is faster than HMAC and is offered here at every BLAKE2b and BLAKE2s length.', ], faq: [ { @@ -77,6 +77,10 @@ export const toolCopy: Record = { q: 'Is an HMAC the same as a hash of key + message?', a: 'No. Hashing the key and message together is open to length-extension attacks with SHA-256 and similar hashes. HMAC, defined in RFC 2104, hashes in two nested passes to avoid that.', }, + { + q: 'Is keyed BLAKE2 the same as HMAC-BLAKE2?', + a: 'No, they give different results. Keyed BLAKE2 feeds the key into the hash’s own parameter block and needs a single pass, while HMAC wraps BLAKE2 in two passes. Use whichever the other side expects.', + }, LOCAL, ], }, @@ -148,6 +152,46 @@ export const toolCopy: Record = { LOCAL, ], }, + url: { + title: 'URL encode and decode online', + about: [ + 'URLs may only contain a small set of characters. Anything else, such as a space, an ampersand or a non-English letter, is written as a percent sign followed by the byte value in hex. This is percent encoding, defined in RFC 3986, and it is what urlencode and encodeURIComponent do.', + 'Type text on the left to encode it, or paste an encoded string on the right to decode it. There are three styles: strict RFC 3986, the encodeURIComponent style that also keeps ! \' ( ) *, and form data, where a space becomes +.', + ], + faq: [ + { + q: 'Should a space be %20 or +?', + a: 'In a URL path, always %20. In a query string sent by an HTML form (application/x-www-form-urlencoded), a space is written as +. Most servers accept %20 in a query string too.', + }, + { + q: 'Why is é encoded as %C3%A9?', + a: 'Text is first turned into UTF-8 bytes, and é is two bytes in UTF-8, C3 and A9. Each byte gets its own percent escape.', + }, + { + q: 'What is the difference between encodeURI and encodeURIComponent?', + a: 'encodeURI leaves characters that have a meaning in a full URL, such as / ? & and =, untouched. encodeURIComponent escapes them, which is what you want for a single query value or path segment. This page encodes like encodeURIComponent or stricter.', + }, + LOCAL, + ], + }, + punycode: { + title: 'Punycode converter for international domain names', + about: [ + 'Domain names can only use ASCII letters, digits and hyphens, so a name like münchen.de is stored as xn--mnchen-3ya.de. The xn-- prefix marks a label written in Punycode, the encoding defined in RFC 3492 that packs Unicode into those characters.', + 'Type a Unicode domain to see its ASCII form, or paste an xn-- name to read it. Untick “Whole domain name” to convert a single label without the xn-- prefix.', + ], + faq: [ + { + q: 'Why does my browser show xn-- in the address bar?', + a: 'Browsers show the Punycode form when a name mixes scripts or looks like another domain, to protect against look-alike phishing domains.', + }, + { + q: 'Does this normalize the name the way browsers do?', + a: 'No. Browsers also lower-case and normalize the name (IDNA 2008 or UTS #46 processing) before encoding. This page encodes exactly the characters you type, so type the name in its usual lower-case form.', + }, + LOCAL, + ], + }, converter: { title: 'Base85, Z85, Base62 and Base45 converter', about: [ @@ -234,6 +278,28 @@ export const toolCopy: Record = { LOCAL, ], }, + aes: { + title: 'AES encryption and decryption: CBC, CTR, ECB, CCM, XTS', + about: [ + 'AES is a block cipher: on its own it encrypts exactly 16 bytes. A mode of operation turns it into something that can encrypt a whole message, and the mode decides how blocks are chained, whether padding is needed and what the IV does.', + 'Pick a mode, enter a key and IV in hex, and encrypt text, hex or Base64. Paste a ciphertext to decrypt it. CBC, ECB, PCBC and IGE pad the message to whole blocks, with PKCS#7 by default; CTR, CFB and OFB need no padding. CCM adds an authentication tag, as RFC 3610 defines, and XTS is the mode used for disk encryption.', + ], + faq: [ + { + q: 'Why does my AES-CBC decryption fail or give garbage?', + a: 'Usually the key, IV or padding differs from what was used to encrypt. Check that the key is the right length in bytes (not characters), that the IV is the one sent with the message, and that both sides use the same padding, most often PKCS#7. Also make sure the ciphertext is decoded from the right format, hex or Base64.', + }, + { + q: 'Which AES mode should I use?', + a: 'For new designs, an authenticated mode: AES-GCM (on the Encrypt and decrypt tool) or CCM. Use CBC, CTR and the others to work with existing systems. Avoid ECB, which leaks patterns in the data.', + }, + { + q: 'What is PKCS#7 padding?', + a: 'It fills the last block with N bytes of value N, so a message that needs 3 more bytes ends in 03 03 03. A message that is already a whole number of blocks gets a full extra block of sixteen 0x10 bytes, so the padding can always be removed without ambiguity.', + }, + LOCAL, + ], + }, 'ml-kem': { title: 'ML-KEM (Kyber) post-quantum key exchange demo', about: [ @@ -289,10 +355,10 @@ export const toolCopy: Record = { ], }, totp: { - title: 'TOTP code generator for 2FA secrets', + title: 'TOTP and HOTP code generator for 2FA secrets', about: [ 'TOTP (RFC 6238) is the algorithm behind authenticator apps. The app and the server share a secret, and every 30 seconds both compute an HMAC of the current time step and turn it into a short code.', - 'Paste a Base32 secret to see the current code and a countdown to the next one. Most services use SHA-1, 6 digits and a 30-second period, and all three can be changed.', + 'Paste a Base32 secret to see the current code and a countdown to the next one. Most services use SHA-1, 6 digits and a 30-second period, and all three can be changed. HOTP (RFC 4226), the counter-based original that hardware tokens use, is here too: enter a counter to see its code and the next four.', ], faq: [ { diff --git a/src/lib/toolbox.ts b/src/lib/toolbox.ts index cc35164..14c2fa8 100644 --- a/src/lib/toolbox.ts +++ b/src/lib/toolbox.ts @@ -2,6 +2,7 @@ // runs them is built by scripts/toolbox.mjs from toolbox/ (Dart). import generated from '../data/generated/toolbox.json'; import { projects, url } from './data'; +import { rfcUrl } from './rfc.mjs'; export type ToolCategory = 'Hash' | 'Encode' | 'Passwords' | 'Encrypt' | 'Generate'; export type Library = 'convertlib' | 'hashlib' | 'cipherlib'; @@ -29,7 +30,7 @@ export interface Tool { export const CATEGORIES: ToolCategory[] = ['Hash', 'Encode', 'Passwords', 'Encrypt', 'Generate']; -const RFC = (n: number) => ({ label: `RFC ${n}`, href: `https://www.rfc-editor.org/rfc/rfc${n}` }); +const RFC = (n: number) => ({ label: `RFC ${n}`, href: rfcUrl(n) }); const FIPS = (n: string, href: string) => ({ label: `FIPS ${n}`, href }); export const tools: Tool[] = [ @@ -38,14 +39,15 @@ export const tools: Tool[] = [ id: 'hash', name: 'Hash text or file', category: 'Hash', - summary: 'SHA-2, SHA-3, BLAKE2, Keccak, RIPEMD, SM3 and MD5, all at once.', - description: 'Compute SHA-256, SHA-512, SHA-3, BLAKE2, Keccak-256, RIPEMD-160, SM3, SHA-1 and MD5 of any text or file, in your browser.', + summary: 'SHA-2, SHA-3, SHAKE, BLAKE2, Keccak, RIPEMD, SM3 and MD5, all at once.', + description: 'Compute SHA-256, SHA-512, SHA-3, SHAKE at any length, BLAKE2, Keccak-256, RIPEMD, SM3, SHA-1, MD5 and more for any text or file, in your browser.', library: 'hashlib', specs: [ FIPS('180-4', 'https://csrc.nist.gov/pubs/fips/180-4/upd1/final'), FIPS('202', 'https://csrc.nist.gov/pubs/fips/202/final'), RFC(7693), RFC(1321), + RFC(1319), ], dart: `import 'package:hashlib/hashlib.dart'; @@ -71,17 +73,21 @@ print(xxh32code('hello world'));`, }, { id: 'hmac', - name: 'HMAC', + name: 'HMAC and keyed BLAKE2', category: 'Hash', - summary: 'Sign a message with a secret key and any supported hash.', - description: 'Compute an HMAC with SHA-256, SHA-512, SHA-3, BLAKE2 and more, in your browser. The key never leaves your device.', + summary: 'Sign a message with a secret key: HMAC with any hash, or keyed BLAKE2.', + description: 'Compute an HMAC with SHA-256, SHA-512, SHA-3 and more, or a keyed BLAKE2b or BLAKE2s MAC, in your browser. The key never leaves your device.', library: 'hashlib', - specs: [RFC(2104), RFC(4231)], - dart: `import 'package:hashlib/hashlib.dart'; + specs: [RFC(2104), RFC(4231), RFC(7693)], + dart: `import 'package:hashlib/codecs.dart'; +import 'package:hashlib/hashlib.dart'; final mac = sha256.hmac.byString('secret key'); -print(mac.string('message').hex());`, - keywords: ['mac', 'signature', 'hmac-sha256', 'keyed hash'], +print(mac.string('message').hex()); + +final key = toUtf8('secret key'); +print(blake2b256.mac.by(key).string('message').hex());`, + keywords: ['mac', 'signature', 'hmac-sha256', 'keyed hash', 'blake2 mac', 'keyed blake2b'], }, // Encode { @@ -141,6 +147,35 @@ print(toBinary(bytes));`, print(toBase58(toUtf8('Hello World!'))); // 2NEpo7TZRRrLZSi2U`, keywords: ['bitcoin', 'b58', 'address'], }, + { + id: 'url', + name: 'URL encode and decode', + category: 'Encode', + summary: 'Percent-encode text for URLs and query strings, and decode it.', + description: 'Percent-encode and decode text for URLs, path segments and form data, following RFC 3986. Both directions update as you type.', + library: 'convertlib', + specs: [RFC(3986)], + dart: `import 'package:convertlib/convertlib.dart'; + +print(toPercent(toUtf8('a b&c'))); // a%20b%26c +print(toPercent(toUtf8('a b'), form: true)); // a+b +print(fromUtf8(fromPercent('caf%C3%A9'))); // café`, + keywords: ['percent encoding', 'urlencode', 'urldecode', 'query string', 'uri', 'escape'], + }, + { + id: 'punycode', + name: 'Punycode converter', + category: 'Encode', + summary: 'Turn international domain names into xn-- form and back.', + description: 'Convert internationalized domain names and labels between Unicode and Punycode (xn--), following RFC 3492.', + library: 'convertlib', + specs: [RFC(3492), RFC(3490)], + dart: `import 'package:convertlib/convertlib.dart'; + +print(toPunycode('münchen.de', domain: true)); // xn--mnchen-3ya.de +print(fromPunycode('xn--mnchen-3ya.de', domain: true));`, + keywords: ['idn', 'idna', 'xn--', 'international domain', 'unicode domain', 'emoji domain'], + }, { id: 'converter', name: 'Encoding converter', @@ -164,7 +199,8 @@ print(toBase85(bytes, codec: Base85Codec.z85)); // HelloWorld`, description: 'Hash a password with Argon2id, Argon2i or Argon2d and verify it against an encoded hash, entirely in your browser.', library: 'hashlib', specs: [RFC(9106)], - dart: `import 'package:hashlib/hashlib.dart'; + dart: `import 'package:hashlib/codecs.dart'; +import 'package:hashlib/hashlib.dart'; final hash = argon2id( toUtf8(password), @@ -182,7 +218,8 @@ final ok = argon2Verify(hash, toUtf8(password));`, description: 'Hash a password with bcrypt at the cost you choose, and verify a password against an existing bcrypt hash, in your browser.', library: 'hashlib', specs: [{ label: 'Provos and Mazières, 1999', href: 'https://www.usenix.org/legacy/events/usenix99/provos/provos.pdf' }], - dart: `import 'package:hashlib/hashlib.dart'; + dart: `import 'package:hashlib/codecs.dart'; +import 'package:hashlib/hashlib.dart'; final hash = bcrypt(toUtf8(password), bcryptSalt(nb: 10)); final ok = bcryptVerify(hash, toUtf8(password));`, @@ -220,6 +257,28 @@ final sealed = aes.encrypt(plaintext); // ciphertext + tag final opened = aes.decrypt(sealed); // throws if tampered`, keywords: ['aes', 'gcm', 'chacha20', 'poly1305', 'aead', 'cipher'], }, + { + id: 'aes', + name: 'AES modes', + category: 'Encrypt', + summary: 'AES in CBC, CTR, ECB, CFB, OFB, CCM, XTS and more, with padding options.', + description: 'Encrypt and decrypt with AES in CBC, CTR, ECB, CFB, OFB, CCM, PCBC, IGE and XTS modes, with PKCS#7 or other padding, in your browser.', + library: 'cipherlib', + specs: [ + { label: 'NIST SP 800-38A', href: 'https://csrc.nist.gov/pubs/sp/800/38/a/final' }, + RFC(3610), + { label: 'IEEE 1619', href: 'https://standards.ieee.org/ieee/1619/4205/' }, + { label: 'FIPS 197', href: 'https://csrc.nist.gov/pubs/fips/197/final' }, + ], + dart: `import 'package:cipherlib/cipherlib.dart'; + +final cbc = AES(key).cbc(iv); // PKCS#7 by default +final ciphertext = cbc.encrypt(plaintext); +final plain = cbc.decrypt(ciphertext); + +final ctr = AES(key).ctr(iv);`, + keywords: ['aes-cbc', 'aes-ctr', 'aes-ecb', 'aes-ccm', 'aes-xts', 'pkcs7', 'padding', 'iv', 'decrypt aes', 'cfb', 'ofb'], + }, { id: 'ml-kem', name: 'ML-KEM key exchange', @@ -267,17 +326,21 @@ final password = randomString(20, lower: true, upper: true, numeric: true);`, }, { id: 'totp', - name: 'TOTP codes', + name: 'TOTP and HOTP codes', category: 'Generate', - summary: 'Live two-factor codes from a shared secret.', - description: 'Show live TOTP two-factor codes for a Base32 secret, with SHA-1, SHA-256 or SHA-512 and 6 to 8 digits.', + summary: 'Two-factor codes from a shared secret: live TOTP, or HOTP by counter.', + description: 'Show live TOTP two-factor codes, or HOTP codes for a counter, from a Base32 secret, with SHA-1, SHA-256 or SHA-512 and 6 to 8 digits.', library: 'hashlib', specs: [RFC(6238), RFC(4226)], - dart: `import 'package:hashlib/hashlib.dart'; + dart: `import 'package:hashlib/codecs.dart'; +import 'package:hashlib/hashlib.dart'; final totp = TOTP(fromBase32(secret)); -print(totp.valueString());`, - keywords: ['2fa', 'otp', 'authenticator', 'one-time password', 'mfa'], +print(totp.valueString()); + +final hotp = HOTP(fromBase32(secret), counter: fromHex('0000000000000001')); +print(hotp.valueString());`, + keywords: ['2fa', 'otp', 'authenticator', 'one-time password', 'mfa', 'hotp', 'counter'], }, ]; diff --git a/src/pages/toolbox/[tool].astro b/src/pages/toolbox/[tool].astro index cec96d2..b4783f0 100644 --- a/src/pages/toolbox/[tool].astro +++ b/src/pages/toolbox/[tool].astro @@ -6,6 +6,7 @@ import { engine, libraryProject, toolUrl, tools, toolsIn, workerUrl, type Tool } import { url } from '../../lib/data'; import { toolCopy } from '../../lib/toolbox-copy'; import { toolGraph } from '../../lib/schema'; +import RfcText from '../../components/RfcText.astro'; import Hash from '../../components/toolbox/Hash.astro'; import Hmac from '../../components/toolbox/Hmac.astro'; import Codec from '../../components/toolbox/Codec.astro'; @@ -17,6 +18,8 @@ import MlKem from '../../components/toolbox/MlKem.astro'; import Uuid from '../../components/toolbox/Uuid.astro'; import Random from '../../components/toolbox/Random.astro'; import Totp from '../../components/toolbox/Totp.astro'; +import Punycode from '../../components/toolbox/Punycode.astro'; +import Aes from '../../components/toolbox/Aes.astro'; export function getStaticPaths() { return tools.map((tool) => ({ params: { tool: tool.id }, props: { tool } })); @@ -37,6 +40,7 @@ const codecs: Record{tool.category}

{tool.name}

-

{tool.description}

+

{ !workerUrl && ( @@ -80,6 +89,8 @@ const checksumIds = ['crc32', 'crc16', 'crc64', 'adler32', 'xxh32', 'xxh64', 'xx {tool.id === 'uuid' && } {tool.id === 'random' && } {tool.id === 'totp' && } + {tool.id === 'punycode' && } + {tool.id === 'aes' && }