FIND YOUR NEXT FEW LINES

Results for “binary”

Small, practical examples. Search by task or narrow things down below.

63 snippets foundClear filters
Arduino / CBinary values & packets

Calculate a simple packet XOR checksum

Arduino / C: XOR all payload bytes to produce a basic error-detection byte.

Arduino / C✓ Tested
Arduino / CBinary values & packets

Clear a flag without affecting neighboring bits

Arduino / C: bitClear resets only the selected bit.

Arduino / C✓ Tested
CBinary formats & structured parsing

Convert ASCII text to lowercase safely

C: Cast to unsigned char before calling ctype functions on a possibly signed char.

C✓ Tested
C#JSON & binary formats

Convert bytes to Base64 and back

C#: Encode text to UTF-8 before converting it to a Base64 representation.

C#✓ Tested
JavaFile operations & binary data

Copy a file without replacing an existing destination

Java: Files.copy fails if the destination already exists unless replacement is explicitly enabled.

Java✓ Tested
JavaFile operations & binary data

Create and clean up a temporary file

Java: Create a unique file and remove it in finally even when the operation fails.

Java✓ Tested
CBinary formats & structured parsing

Decode a 16-bit big-endian integer

C: Promote bytes to an unsigned integer type before combining shifted values.

C✓ Tested
CBinary formats & structured parsing

Decode a validated pair of hexadecimal digits

C: Convert each nibble and reject a nonhexadecimal character before combining them.

C✓ Tested
C#JSON & binary formats

Decode hexadecimal bytes

C#: FromHexString and ToHexString handle binary data without manually parsing pairs of characters.

C#✓ Tested
JavaFile operations & binary data

Delete a known temporary file if present

Java: deleteIfExists returns whether a file was removed and still reports other I/O errors.

Java✓ Tested
C#JSON & binary formats

Deserialize a JSON object into a dictionary

C#: Specify the value type expected from a known JSON shape.

C#✓ Tested
CBinary formats & structured parsing

Encode a byte buffer as hexadecimal

C: Format each byte as an unsigned two-digit hexadecimal value.

C✓ Tested