# MoriDev — Complete Technical & Tool Reference Canonical Site: https://dev.moritools.com Total Developer Utilities: 24 Execution Model: 100% Client-Side Browser Runtime (Zero Server Uploads, Offline Capable) Sister Hubs: https://moritools.com | https://calc.moritools.com Contact: zining6626@gmail.com --- # Category: JSON & Structured Data (https://dev.moritools.com/json-data) Backend engineers constantly inspect webhook payloads, migration exports, CI manifests, and production SQL queries that cannot legally touch third-party SaaS debuggers. Every parser and serializer in this suite executes synchronously in your tab using pure TypeScript. ## JSON Formatter, Validator & Tree Minifier URL: https://dev.moritools.com/json-formatter Standard / Badge: RFC 8259 Summary: Paste any raw API response or log line to pretty-print with 2 spaces, 4 spaces, or tabs, recursively alphabetize object properties, collapse into single-line minified output, and inspect exact line-and-column parse errors entirely offline. ### Key Engineering Pitfalls - **Trailing Commas & JS Object Literals**: TypeScript and ES modules tolerate a trailing comma after the final element of an array or object, yet JSON.parse throws immediately. Always strip comments and trailing commas before feeding config files to strict parsers. - **IEEE 754 64-Bit Integer Precision Loss**: JavaScript numbers lose integer precision above 2^53 - 1 (9007199254740991). Snowflake IDs from Discord or X should travel as quoted strings. This formatter keeps the original digits instead of rounding them. - **Duplicate Object Keys Silencing Earlier Values**: RFC 8259 advises unique member names, but standard parsers silently overwrite earlier duplicate keys with the last occurrence, creating subtle security mismatches between proxy validators and downstream microservices. ### Worked Examples - **Spotting a Trailing Comma with Caret Coordinates** - Input: {"env": "prod", "retries": 3,} - Output: Syntax error at line 1, column 30 -> trailing comma before closing brace - Why: Removing the comma after 3 restores strict RFC 8259 compliance across Go, Rust, Python, and browsers. - **Deterministic Snapshot Canonicalization** - Input: {"z":1,"a":{"d":4,"b":2}} - Output: { \n "a": { \n "b": 2, \n "d": 4 \n }, \n "z": 1 \n } - Why: Enabling Sort Keys stabilizes Git diffs and golden test fixtures regardless of upstream serializer key ordering. ### Frequently Asked Questions - **Q: Does pasting production API payloads trigger any network call?** A: No. Formatting, key sorting, minification, and error offset mapping execute strictly through the browser JavaScript runtime with zero outbound requests. - **Q: Why does valid JavaScript fail JSON validation here?** A: JavaScript permits single quotes, undefined, NaN, comments, and unquoted keys. Strict JSON (RFC 8259) requires double-quoted property names and forbids comments or trailing commas. - **Q: Does Sort Keys reorder elements inside JSON arrays?** A: No. Arrays are ordered sequences in JSON, so recursive key sorting only alphabetizes object keys while leaving every array index untouched. - **Q: How much bandwidth does minifying JSON actually save?** A: Pretty-printed payloads with nested objects typically shrink by 15% to 35% after removing indentation and newlines, before gzip or Brotli compression is even applied. --- ## JSON Deep Diff & Semantic Compare URL: https://dev.moritools.com/json-diff Standard / Badge: RFC 6902 Summary: Drop an original payload on the left and a modified payload on the right to compute a key-order-insensitive structural diff, isolate exact JSONPath changes, and generate an RFC 6902 JSON Patch document. ### Key Engineering Pitfalls - **Type Drift Between String and Number**: Changing "port": 5432 to "port": "5432" looks minor visually but breaks strongly typed Go, Rust, and Zod consumers. Semantic diff flags strict primitive type changes immediately. - **Null Versus Omitted Property Semantics**: In PATCH endpoints and GraphQL inputs, an absent key typically means "do not touch" while an explicit null means "clear this column." Deep diff distinguishes removed keys from replaced-with-null values. - **JSON Pointer Escaping for Slashes and Tildes**: When generating RFC 6902 patches for keys containing "/" or "~" (such as Kubernetes annotations), RFC 6901 requires encoding "~" as "~0" and "/" as "~1" so patch applicators target the exact key. ### Worked Examples - **Ignoring Shuffled Object Keys** - Input: Left: {"b":2,"a":1} vs Right: {"a":1,"b":2} - Output: 0 added, 0 removed, 0 changed (structurally identical) - Why: Reordering object keys does not alter JSON semantics, eliminating noisy false positives during microservice migrations. - **Detecting Nested Feature Flag Flip** - Input: Left: {"flags":{"canary":false}} vs Right: {"flags":{"canary":true}} - Output: ~ $.flags.canary: false -> true (JSON Patch op: replace /flags/canary) - Why: Produces both human-readable JSONPath notation and a machine-applicable patch operation. ### Frequently Asked Questions - **Q: Does this diff ignore whitespace and object property ordering?** A: Yes. Both sides are parsed into AST values before comparison, so indentation differences and reordered keys produce zero diff noise. - **Q: How are array elements compared?** A: Arrays are compared index-by-index because JSON array order is semantically meaningful. Extra trailing items appear as added, truncated indices as removed, and altered elements recursively diff their internals. - **Q: Can I apply the generated JSON Patch directly in backend tests?** A: Yes. The patch output conforms to RFC 6902 using add, remove, and replace operations with properly escaped RFC 6901 JSON Pointer paths. - **Q: What happens if one side contains invalid JSON?** A: The engine reports which panel failed (Left or Right) along with the exact line and column of the syntax error without wiping your other pane. --- ## YAML ↔ JSON Bidirectional Converter URL: https://dev.moritools.com/yaml-to-json Standard / Badge: YAML 1.2 Summary: Switch instantly between YAML → JSON and JSON → YAML to inspect CI workflows, Helm values, or OpenAPI specs, complete with multiline literal block (|) support and safe string quoting. ### Key Engineering Pitfalls - **The Norway Problem (Unquoted Booleans)**: Legacy YAML 1.1 parsers silently coerce bare values like NO, on, or off into booleans, turning Norway country code NO into false. YAML 1.2 restricts booleans strictly to true and false, and our serializer quotes ambiguous words automatically. - **Tab Indentation Parse Failures**: Unlike Makefiles or Go files, YAML forbids tab characters for block indentation. Pasting snippets from terminals or spreadsheets often sneaks in leading tabs; this parser catches the exact offending line immediately. - **Unquoted Version Numbers Turning Into Floats**: Writing version: 1.10 without quotes parses as the float 1.1, silently dropping the trailing zero in container tags or API versions. Wrap semantic version strings in quotes. ### Worked Examples - **Converting a Sequence of Service Objects** - Input: services: \n - name: auth \n port: 8081 \n - name: billing \n port: 8082 - Output: {"services":[{"name":"auth","port":8081},{"name":"billing","port":8082}]} - Why: Inline sequence-of-mappings notation translates cleanly into an array of structured JSON objects. - **Safe Quoting on JSON to YAML Export** - Input: {"country":"NO","portLabel":"0800","tag":"v1:latest"} - Output: country: "NO" \n portLabel: "0800" \n tag: v1:latest - Why: Strings that look like numbers or YAML 1.1 booleans are wrapped in double quotes so every parser keeps them as strings. ### Frequently Asked Questions - **Q: Does YAML to JSON preserve comments?** A: JSON has no comment syntax in RFC 8259, so comments are stripped during YAML-to-JSON conversion while # symbols inside quoted strings stay intact. - **Q: Why does the converter reject leading tabs?** A: The official YAML specification prohibits tabs as indentation whitespace because editors render tab stops inconsistently. Replace leading tabs with two spaces. - **Q: How are multiline strings exported when converting JSON back to YAML?** A: Strings containing newline characters automatically serialize using YAML literal block syntax (| or |-) so multi-line scripts and PEM snippets remain readable. - **Q: Can I swap output back into the input pane to test round-tripping?** A: Yes. Click Swap in the action toolbar to invert direction and feed the generated document back through the opposite parser. --- ## JSON to CSV & CSV to JSON Converter URL: https://dev.moritools.com/json-to-csv Standard / Badge: RFC 4180 Summary: Transform API arrays of nested JSON objects into RFC 4180 CSV files with automatic dot-key flattening and one-click .csv download, or parse complex quoted CSV exports back into typed JSON. ### Key Engineering Pitfalls - **Naive Comma Splitting Breaks Quoted Fields**: A cell like "Austin, TX" or "Includes ""priority"" SLA" contains internal commas and quotes. Only a stateful RFC 4180 tokenizer preserves column boundaries across quoted fields and embedded line breaks. - **Heterogeneous JSON Rows Missing Optional Columns**: When row 1 omits a discountCode property that appears on row 47, scanning only the first object drops the column. This converter unions all keys across every record before emitting the header row. - **European Semicolon Delimiters & UTF-8 BOM**: Regional Excel installations expect semicolons when commas act as decimal separators, and CSV exports from Windows frequently start with a UTF-8 BOM (\uFEFF). Our parser strips BOMs automatically and lets you pick the delimiter. ### Worked Examples - **Flattening Nested Billing Records** - Input: [{"id":1,"buyer":{"name":"Ada","vip":true}},{"id":2,"buyer":{"name":"Linus"}}] - Output: id,buyer.name,buyer.vip \n 1,Ada,true \n 2,Linus, - Why: Every object key across all rows is collected into a unified header, leaving missing optional fields empty. - **Parsing Multiline Quoted CSV Back to JSON** - Input: sku,notes \n A-10,"Line 1 \n Line 2, ""fragile""" - Output: [{"sku":"A-10","notes":"Line 1\nLine 2, \"fragile\""}] - Why: The stateful parser keeps the embedded newline and unescapes doubled quotes accurately. ### Frequently Asked Questions - **Q: Can I convert a single JSON object instead of an array?** A: Yes. If the root JSON value is a plain object, the converter wraps it as a single data row under its extracted header columns. - **Q: Does CSV to JSON reconstruct nested objects from dot headers?** A: Toggle the Unflatten / Flatten option when switching to CSV → JSON to rebuild columns like customer.name into nested {"customer":{"name":"..."}} structures. - **Q: How does type inference handle numbers and booleans in CSV?** A: CSV stores everything as text; when converting CSV to JSON, numeric strings, true/false, and null are parsed into native JSON primitives while preserving zip codes or mixed text safely. - **Q: Can I download the resulting spreadsheet directly?** A: Click Download in the toolbar to save a clean .csv (or .json in reverse mode) file generated via a local Blob URL. --- ## JSON to TypeScript Interface & Zod Schema Generator URL: https://dev.moritools.com/json-to-typescript Standard / Badge: TS + Zod Summary: Paste any REST or webhook JSON sample to derive PascalCase TypeScript interfaces alongside matching Zod runtime schemas, complete with optional properties (?) inferred across heterogeneous array elements. ### Key Engineering Pitfalls - **Sampling Only the First Array Item**: Many naïve generators inspect array[0] and ignore array[1..n], missing optional keys or nullable fields that only appear on later records. Merging all elements yields accurate optional (?) and union types. - **Trusting Compile-Time Interfaces at Network Boundaries**: Casting fetch().json() as MyType offers zero runtime protection. Pairing interfaces with a Zod schema at the boundary catches schema drift before undefined crashes UI components. - **Invalid Identifier Characters in API Keys**: Keys like "x-rate-limit" or "@context" are legal in JSON but illegal as bare TypeScript property names. The emitter automatically quotes non-identifier keys while keeping clean keys unquoted. ### Worked Examples - **Merging Optional Fields Across Array Objects** - Input: [{"region":"iad","canary":10},{"region":"fra"}] - Output: export type Root = RootItem[]; \n \n export interface RootItem { \n region: string; \n canary?: number; \n } - Why: Because the second object omits canary, the generator marks canary as optional rather than required. - **Nullable Union in Zod Output** - Input: {"rollbackTarget":null,"id":"dep_1"} - Output: z.object({ rollbackTarget: z.null(), id: z.string() }) - Why: Explicit null fields stay visible so you can widen them to .nullable() with one edit when string values are also possible. ### Frequently Asked Questions - **Q: Can I customize the root interface and Zod schema name?** A: Yes. Change the Root Type Name input (for example DeploymentEvent) and both the exported TypeScript interface and camelCase Zod constant update immediately. - **Q: Why does an empty array infer unknown[] instead of any[]?** A: TypeScript strict mode discourages any because it disables downstream type checking. Using unknown[] forces explicit narrowing once real array items are known. - **Q: How are naming collisions between nested objects resolved?** A: Each nested object receives a PascalCase name derived from its property key (singularized for arrays), with numeric suffixes appended automatically if two distinct nested shapes share a name. - **Q: Does the generated Zod file work with TypeScript strict mode?** A: Yes. It imports { z } from "zod", exports the schema constant, and exports a derived z.infer type alias. --- ## SQL Formatter & Beautifier URL: https://dev.moritools.com/sql-formatter Standard / Badge: PG · MySQL · SQLite Summary: Paste tangled ORM-generated queries or slow-query log lines to format PostgreSQL, MySQL, or SQLite SQL with clean clause indentation, uppercase keywords, and safe preservation of quoted literals and comments. ### Key Engineering Pitfalls - **Mutating Keywords Inside String Literals**: Regex-based formatters frequently uppercase words inside WHERE note = 'select from list', corrupting filter predicates. Tokenizing strings first guarantees literals remain byte-identical. - **Dialect Quoting Differences Across Engines**: MySQL quotes identifiers with backticks (`order`) and treats # as a line comment, whereas PostgreSQL uses double quotes ("order"), :: type casts, and ->> JSONB operators. Selecting the right dialect avoids token splits. - **Minifying Queries Containing Line Comments (--)**: Collapsing newlines without stripping -- comments turns everything after the first comment into commented-out dead SQL. Minify mode removes comments cleanly before joining tokens. ### Worked Examples - **Untangling an Aggregation Query** - Input: select user_id, count(*) from events where kind = 'click' and created_at > '2026-01-01' group by user_id order by 2 desc limit 20; - Output: SELECT \n user_id, \n count(*) \n FROM events \n WHERE kind = 'click' \n AND created_at > '2026-01-01' \n GROUP BY user_id \n ORDER BY 2 DESC \n LIMIT 20; - Why: Major clauses anchor at column zero while SELECT columns and boolean predicates indent cleanly for rapid code review. - **Protecting PostgreSQL Operators** - Input: select data->>'email' as email, amount::numeric from billing; - Output: SELECT \n data ->> 'email' AS email, \n amount::numeric \n FROM billing; - Why: Type casts (::) remain tightly bound to their operands while keywords switch cleanly to uppercase. ### Frequently Asked Questions - **Q: Will formatting change text inside my WHERE string values?** A: No. The lexer isolates single-quoted strings, PostgreSQL dollar quotes, and quoted identifiers before keyword casing or clause line breaks run. - **Q: Can I format multiple semicolon-separated SQL statements at once?** A: Yes. Semicolons terminate each statement cleanly with a blank separator line and report the total statement count. - **Q: Does SQL Formatter connect to any database?** A: No. It performs purely syntactic tokenization and formatting locally in your browser without executing queries or sending table names anywhere. - **Q: When should I use Minify mode?** A: Minify mode is useful when embedding SQL inside environment variables, curl test fixtures, or compact log assertions where newlines are awkward. --- # Category: Encoding, Crypto & Tokens (https://dev.moritools.com/encoding-security) Pasting live OAuth access tokens, webhook signing secrets, or customer-facing payloads into remote web forms creates instant credential leakage. These utilities run on native browser Web Crypto and UTF-8 codecs, so the tokens, keys, and files you enter never leave your browser, and no cookies track you. ## JWT Decoder & Claims Inspector URL: https://dev.moritools.com/jwt-decoder Standard / Badge: RFC 7519 · Zero Upload Summary: Paste any Bearer or raw three-part JSON Web Token to inspect its decoded Header, Payload, signature segment, and human-readable exp/iat/nbf countdowns strictly in local memory—your token never touches a server. ### Key Engineering Pitfalls - **Confusing Decoding With Cryptographic Verification**: Anyone can Base64URL-decode a JWT header and payload without the secret key. Never trust decoded claims for authorization until the backend verifies the signature against a pinned JWKS public key or HMAC secret. - **Algorithm Confusion & alg="none" Bypass**: Older JWT libraries blindly trusted the header alg field, allowing attackers to forge tokens by switching RS256 to HS256 (signing with the public key) or setting alg="none". Always enforce an explicit algorithm allowlist on your server. - **Clock Skew Around nbf and exp Claims**: Distributed containers with 5 to 30 seconds of NTP drift can reject freshly minted tokens whose nbf (Not Before) timestamp lies slightly in the future. Most OIDC verifiers allow a small 30–60s leeway. ### Worked Examples - **Spotting an Expired Access Token** - Input: Header {"alg":"RS256","typ":"JWT"} · Payload {"sub":"usr_9","exp":1700000000} - Output: Status: Expired — 2023-11-14T22:13:20.000Z (shows exact elapsed duration) - Why: Instantly distinguishes expired-token 401 failures from wrong-audience or missing-scope 403 errors. - **Catching an Unsecured Token Header** - Input: eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJyb2xlIjoiYWRtaW4ifQ. - Output: CRITICAL warning: Header declares alg="none" and signature segment is empty - Why: Surfaces high-severity auth misconfigurations immediately during penetration testing or QA. ### Frequently Asked Questions - **Q: Is it truly safe to inspect real staging or production JWTs here?** A: Yes. MoriDev is a 100% static site with zero backend APIs—you can even unplug your network cable or toggle offline mode in DevTools and JWT decoding still works identically. - **Q: Why does JWT use Base64URL instead of standard Base64?** A: Standard Base64 uses +, /, and = padding characters that require percent-encoding in URLs and HTTP headers. Base64URL replaces + with -, / with _, and omits trailing = padding. - **Q: Can this tool tell if the JWT signature is cryptographically valid?** A: No. Verifying a signature requires your server private HMAC secret or IdP JWKS public key. This inspector focuses on safe client-side header/payload decoding, timestamp checks, and structural security warnings. - **Q: Why did my JWT fail with "expected 3 dot-separated segments"?** A: Standard signed tokens (JWS) contain header.payload.signature. Five-segment tokens are encrypted JWE payloads whose ciphertext cannot be read without the decryption private key. --- ## Base64 & Base64URL Encoder / Decoder URL: https://dev.moritools.com/base64-encoder-decoder Standard / Badge: RFC 4648 · UTF-8 Summary: Convert arbitrary UTF-8 strings (including Chinese, Japanese, and multi-byte Emoji) into RFC 4648 Base64 or URL-safe Base64URL, or drop a local image/asset to generate an inline Data URI with zero upload. ### Key Engineering Pitfalls - **Using btoa() Directly on Unicode Strings**: Passing "🚀" or "中文" directly to window.btoa throws DOMException. Encoding to UTF-8 bytes first ensures interoperability with Go encoding/base64, Python base64, and OpenSSL. - **Treating Base64 as Encryption**: Base64 adds zero confidentiality—it is a reversible 3-byte-to-4-character transport encoding that inflates binary size by ~33%. Never store passwords or API secrets in Base64 expecting secrecy. - **Missing Padding (=) on Strict Backend Decoders**: While Base64URL commonly omits trailing = characters, some Java, Python, and Go standard Base64 decoders reject unpadded strings unless length % 4 == 0. Our decoder auto-pads transparently while letting you control output padding. ### Worked Examples - **Encoding Multi-Byte UTF-8 Emoji & CJK** - Input: 安全 🚀 - Output: 5a6J5YWoIPCfmoA= (Standard) / 5a6J5YWoIPCfmoA (Base64URL) - Why: 11 UTF-8 bytes encode cleanly into 16 Base64 characters without InvalidCharacterError. - **Decoding a Data URI Payload** - Input: data:text/plain;base64,SGVsbG8gTW9yaURldg== - Output: Hello MoriDev - Why: The decoder automatically strips the data:*;base64, header before converting bytes back to UTF-8 text. ### Frequently Asked Questions - **Q: Does dragging a local file here upload the file anywhere?** A: No. Files dropped into the dropzone are read into an in-memory ArrayBuffer inside your browser tab via File.arrayBuffer() and immediately converted to a Base64 Data URI. - **Q: When should I pick Base64URL over standard Base64?** A: Choose Base64URL for JWT segments, OAuth2 PKCE code challenges, signed cookies, URL query tokens, and filesystem-safe keys. - **Q: Why does my Base64 string grow by one-third?** A: Base64 packs 6 bits of binary data into each 8-bit ASCII character (2^6 = 64 symbols), creating an exact 4:3 byte expansion ratio plus up to two padding characters. - **Q: Can the decoder handle Base64 copied with line breaks from PEM or MIME?** A: Yes. All CR, LF, and whitespace characters are stripped before decoding, matching standard MIME and OpenSSL Base64 handling. --- ## Bulk UUID v4 / UUID v7 / ULID / NanoID Generator URL: https://dev.moritools.com/uuid-ulid-generator Standard / Badge: RFC 9562 · CSPRNG Summary: Mint 1–100 CSPRNG-backed UUID v4, RFC 9562 time-ordered UUID v7, Crockford Base32 ULIDs, or compact URL-safe NanoIDs in one click, and decode the exact millisecond creation timestamp embedded inside any UUID v7 or ULID. ### Key Engineering Pitfalls - **Using Math.random() for Identifier Entropy**: Math.random() is a non-cryptographic PRNG with narrow internal state and predictable sequences. Production tokens and primary keys must use Web Crypto CSPRNG (crypto.getRandomValues). - **Exposing Creation Timestamps in Sensitive Public URLs**: Because UUID v7 and ULID encode millisecond timestamps in their leading characters, competitors can estimate record creation dates or ingestion rates from public URLs. Use UUID v4 or NanoID for opaque public share links. - **Confusing Crockford Base32 With Standard Base32**: ULIDs intentionally exclude I, L, O, and U to avoid visual ambiguity when humans read IDs aloud. Standard RFC 4648 Base32 decoders will misinterpret ULID timestamps. ### Worked Examples - **Inspecting a UUID v7 Timestamp** - Input: 0193f8a2-7c00-7a4b-9e12-4c9a12b7e810 - Output: Format: UUID v7 · 48-bit prefix 0x0193f8a27c00 -> 2024-12-24T12:26:58.432Z - Why: Extracting the first 12 hex digits recovers exact millisecond creation time without querying a created_at column. - **Choosing NanoID Length for Short Links** - Input: Kind: NanoID, Length: 21, Count: 10 - Output: 10 URL-safe 21-char IDs (~126 bits of entropy) - Why: 21 characters from a 64-symbol alphabet deliver slightly more entropy than UUID v4 while saving 15 characters per URL. ### Frequently Asked Questions - **Q: Why is UUID v7 replacing UUID v4 in PostgreSQL 17/18 and modern backends?** A: UUID v7 retains the exact 16-byte binary uuid column format while sorting chronologically by leading timestamp bits, dramatically reducing B-tree page splits and WAL bloat. - **Q: Are generated identifiers guaranteed to use cryptographic randomness?** A: Yes. Every random byte comes from the browser native Web Crypto API (crypto.getRandomValues), sourced from the OS CSPRNG. - **Q: Can I extract the timestamp from a UUID v4?** A: No. UUID v4 contains no time component—all 122 payload bits are purely random. Only time-ordered formats like UUID v7 and ULID carry embedded millisecond timestamps. - **Q: How many IDs can I generate at once?** A: You can generate batches from 1 up to 100 identifiers per run, toggle uppercase formatting, copy the entire newline-separated batch, or download as a .txt file. --- ## SHA-256 / SHA-512 / SHA-1 / HMAC Local Hash Generator URL: https://dev.moritools.com/hash-generator Standard / Badge: Web Crypto API Summary: Hash UTF-8 text or drag any local binary file (tarball, ISO, release artifact) to compute hardware-accelerated SHA-256, SHA-512, SHA-384, SHA-1, and optional HMAC-SHA256/512 signatures strictly via browser crypto.subtle. ### Key Engineering Pitfalls - **Trailing Newline Mismatch in CLI vs Browser Hashes**: Running echo "hello" | shasum -a 256 hashes "hello\n" (6 bytes), whereas printf "hello" hashes 5 bytes. Always verify byte length when comparing hashes across terminal and web tools. - **Re-Serializing JSON Before Verifying Webhook HMACs**: HMAC signatures cover the exact raw HTTP request body bytes. Parsing req.body into JSON and calling JSON.stringify again alters whitespace or key ordering and invalidates every signature check. - **Using Raw SHA-256 for Password Storage or SHA-1 for Security**: SHA-1 is cryptographically broken for collision resistance (SHAttered attack), and fast unkeyed SHA-256 can be brute-forced at billions of guesses per second on GPUs. Always use Argon2id, scrypt, or bcrypt for user passwords. ### Worked Examples - **Known SHA-256 Empty-Input Vector** - Input: (empty string — 0 bytes) - Output: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - Why: NIST FIPS 180-4 empty message vector confirms exact Web Crypto SHA-256 compliance. - **Signing a Webhook Body With HMAC-SHA256** - Input: Payload: {"event":"paid"} · Secret: whsec_demo - Output: Deterministic 64-char hex MAC matching Node crypto.createHmac("sha256", secret) - Why: Useful for reproducing webhook headers locally without exposing signing secrets to remote debuggers. ### Frequently Asked Questions - **Q: Does dropping a file upload it to MoriDev servers?** A: Never. The file is read locally via File.arrayBuffer() and passed straight to window.crypto.subtle.digest in your browser memory. - **Q: Why is MD5 omitted in favor of SHA-256 and Web Crypto?** A: Web Crypto (crypto.subtle) intentionally excludes MD5 because MD5 collisions can be forged in seconds on a laptop. SHA-256 and SHA-512 are the modern integrity standards. - **Q: Why does my SHA-256 differ from `echo text | sha256sum`?** A: The Unix echo command appends a trailing newline (\n) by default. Use `printf "%s" "text" | sha256sum` to hash the exact string without an extra newline. - **Q: How should my backend compare HMAC digests safely?** A: Always compare expected and received HMAC buffers with a constant-time routine such as Node crypto.timingSafeEqual to prevent timing side-channel leaks. --- ## HTML Entities & Special Characters Encoder / Decoder URL: https://dev.moritools.com/html-entity-encoder Standard / Badge: HTML5 Entities Summary: Escape raw <, >, &, ", and ' markup into safe HTML5 entities (with optional non-ASCII numeric decimal or hex encoding) or decode named and numeric entities like — and 🚀 back into readable UTF-8 text. ### Key Engineering Pitfalls - **Forgetting Single Quotes (') Inside HTML Attributes**: Escaping only <, >, and " leaves single-quoted attributes like title='user input' vulnerable to attribute breakout. Always encode apostrophes as ' (avoid ' for legacy HTML4/email clients). - **Double-Escaping Ampersands (&amp;)**: Running an encoder twice over already-escaped copy converts © into &copy;, rendering literal entity code on screen. Decode once to inspect the real underlying string before re-encoding. - **Using HTML Entities Inside JavaScript or CSS Contexts**: HTML entity encoding protects HTML element body and attribute contexts only. Placing HTML-encoded text inside a - Output:

Click here or <script>steal()</script>

- Why: Both the dangerous link scheme and raw script tag are neutralized before DOM rendering or HTML export. - **Exporting Clean Semantic HTML for Docs or CMS** - Input: Switch preview tab to "Clean HTML" -> Copy or Download .html - Output: Compact semantic

, ,