Endian-Aware Binary Reader
Parse and build big-endian length-prefixed frames with a version byte, flags, checksum, and explicit truncation errors.
Page 8 of 8
Parse and build big-endian length-prefixed frames with a version byte, flags, checksum, and explicit truncation errors.
Match strings against star and question-mark patterns with backtracking that avoids exponential blowup on repeated stars.
Count differing bits between equal-length byte slices, report bit similarity, and reject inputs of unequal length.
Convert bytes to lowercase hex and back, accepting an optional prefix and embedded whitespace while rejecting invalid digits.
Parse INI sections and key-value pairs into a sorted map, trimming quotes and rejecting malformed headers or empty keys.
Identify PNG, JPEG, GIF, PDF, ZIP, and gzip files from their leading bytes, then check whether the extension agrees.
Normalize an untrusted relative path component by component and reject anything that would climb above the allowed root.
Serve typed JSON from Axum 0.8 with path and query extractors, explicit 400 and 404 errors, and shared map state behind an Arc.
Keep the largest K values from a stream in a bounded min-heap using Reverse, then return them sorted from highest to lowest.
Coordinate producers and consumers with a bounded VecDeque, Mutex, and two condition variables for blocking push and pop.
Split identifiers on separators and case boundaries, then rebuild them as snake_case or camelCase without external crates.
Track failures with closed, open, and half-open states so a failing dependency is rejected fast until a cooldown trial succeeds.
Deserialize CSV records into typed Serde structs with header mapping, numeric parsing, and an error on negative quantities.
Model transport, timeout, and validation failures in one error enum, then decide retryability without matching on strings.
Model configuration failures with a custom Rust error enum, Display and Error implementations, From conversion, and preserved parse causes.
Inject a manually advanced clock into token expiry logic so tests never sleep and boundary conditions stay reproducible.
Support point updates and range-sum queries in logarithmic time with a compact binary indexed tree and low-bit navigation.
Receive filesystem notifications through notify, keep the watcher alive with a handle, and collapse rapid events into one batch.
Reuse expensive objects through a mutex-backed pool whose guard returns the item automatically on drop, with a factory fallback.
Signal shutdown with Tokio Notify, let each worker finish its current cycle, and join every task before the process exits.
Compress an in-memory payload with flate2's GzEncoder, decompress it through GzDecoder, and verify the round trip byte for byte.
Track in-flight and completed requests by idempotency key, replay stored responses within a TTL, and release abandoned work.
Chain Rust iterators to filter refunded orders, fold totals, group revenue by customer, and rank the top accounts without extra crates.
Compute rolling sums and averages over fixed-size windows with slice iterators, avoiding index loops and extra allocations.
Implement an LRU cache with a hash map and a recency queue, evicting by capacity and expiring entries by timestamp.
Initialize process-wide configuration exactly once across threads with std::sync::OnceLock, then read it without locks or clones.
Model order status as an enum and allow only the transitions place, pay, ship, and cancel from valid states.
Search text for every occurrence of a pattern with a rolling Rabin-Karp hash and verify collisions by direct comparison.
Retry fallible async operations with capped exponential delays, per-attempt jitter, and a final error carrying the attempt count.
Select healthy backends in round-robin order with an atomic cursor, skipping failed nodes and returning none when all fail.
Encode repeated characters with counts and decode the result back, rejecting zero counts and dangling numeric prefixes.
Map slices in chunks with std::thread::scope, join worker results in order, and avoid unsafe shared mutable state.
Accept a space-separated string or a JSON array for one Serde field using a custom Visitor, defaults, and unknown-field rejection.
Map Rust field names to camelCase and reserved API keys with serde attributes while keeping a strongly typed struct.
Deduplicate concurrent async lookups for the same key so one leader performs the work and followers receive the shared result.
Consume a text/event-stream response with reqwest and parse event, data, and comment lines into complete server-sent events.
Create a unique temporary directory guarded by Drop cleanup, reject escaping write paths, and remove nested files automatically.
Refill a token bucket from a monotonic clock, allow short bursts, and compute how long a caller must wait when it is empty.
Share a tokio semaphore across spawned tasks, hold a permit for each job, and collect every result with JoinSet.
Bound each async call with tokio timeout, retry transient failures with linear backoff, and return one typed exhaustion error.
Recursively merge TOML tables so environment overlays change only the keys they declare while preserving sibling settings.
Derive RFC 6238 time-based one-time codes from a Base32 secret, with counter packing, dynamic truncation, and modulo digits.
Build a trie from weighted words, return prefix matches sorted by score, and cap the output to keep responses small.
Wrap numeric identifiers in a newtype that parses a prefixed string, rejects zero values, and prints a padded canonical form.
Generate 26-character Crockford base32 identifiers from a millisecond timestamp and monotonic randomness that sorts correctly.
Percent-encode URL query keys and values as UTF-8, preserving unreserved characters and encoding spaces as %20.
Walk a directory tree without following symlinks, skip hidden entries, and collect regular files matching one extension.
Parse semantic versions and requirement ranges, test whether a release satisfies a range, and pick the highest matching version.
Split a command line into arguments with single quotes, double quotes, escapes, and explicit errors for unterminated quotes.
Validate archive entry names before extraction, blocking absolute paths, parent traversal, and anything outside the destination.
Spawn a batch of async tasks, collect results as they finish, and abort everything still running when a deadline expires.
Wrap credentials in a type that wipes memory on drop, redacts itself in debug output, and zeroes temporary buffers explicitly.
Implement JWT authentication in Rust using the jsonwebtoken crate with HMAC-SHA256 signing, claims validation, expiry checking, and Axum extractor for.
Build a command-line tool in Rust using Clap with derive macros for subcommands, typed arguments, environment variable fallback, colored output, and shell.
Handle multipart file uploads in Rust using Axum with size limits, content type validation, streaming to disk, and async file operations using tokio for.
Validate form data in Rust using serde Deserialize with custom validation, error collection, and JSON response generation. Includes nested struct validation.
Make HTTP requests in Rust using reqwest with async/await, retry logic, JSON deserialization with serde, timeout handling, and connection pooling for.
Build a type-safe HTTP server in Rust using Axum with extractors, JSON responses, error handling, and state sharing. Includes route definitions, middleware.