Results for “Encoding & structured values”
Small, practical examples. Search by task or narrow things down below.
Calculate a SHA-256 text digest
Calculate a SHA-256 text digest using a complete Go program with explicit sample inputs.
Go✓ Tested
Calculate a simple packet XOR checksum
Arduino / C: XOR all payload bytes to produce a basic error-detection byte.
Arduino / C✓ Tested
Capture configuration by value in a callable
C++: A value capture retains the value from lambda creation even if the original variable changes later.
C++✓ Tested
Chain operations that may return None
Chain operations that may return None in a complete Rust program using the standard library.
Rust✓ Tested
Check a literal prefix with ordinal comparison
C#: Choose StringComparison.Ordinal when a prefix is a protocol token rather than culture-dependent text.
C#✓ Tested
Check an extension without case sensitivity
C#: Use an explicit ordinal case-insensitive comparison for a known filename suffix.
C#✓ Tested
Clear a flag without affecting neighboring bits
Arduino / C: bitClear resets only the selected bit.
Arduino / C✓ Tested
Compare Unicode text without case
Python: Casefold handles more Unicode case mappings than lower for caseless comparison.
Python✓ Tested
Convert ASCII text to lowercase safely
C: Cast to unsigned char before calling ctype functions on a possibly signed char.
C✓ Tested
Convert hexadecimal text to bytes
Python: Use bytes.fromhex for a readable byte representation and hex for the reverse conversion.
Python✓ Tested
Decode a percent-encoded URL component
JavaScript: decodeURIComponent reverses percent encoding and throws for malformed sequences.
JavaScript✓ Tested
Decode a percent-encoded URL component
TypeScript: decodeURIComponent reverses percent encoding and throws for malformed sequences.
TypeScript✓ Tested