FIND YOUR NEXT FEW LINES

Results for “byte”

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

114 snippets foundClear filters
RustParsing & byte data

Parse a signed decimal integer

Parse a signed decimal integer in a complete Rust program using the standard library.

Rust✓ Tested
Arduino / CSerial protocols

Read a fixed-size serial payload

Arduino / C: readBytes returns the number of bytes actually received.

Arduino / C✓ Tested
Linux CommandsStreams & byte tools

Save a stream while displaying it

Linux Commands: Use tee to write a copy of standard input to a file.

Linux Commands✓ Tested
Linux CommandsStreams & byte tools

Split a file into fixed line-count pieces

Linux Commands: Use numeric suffixes for predictable filenames when splitting a large text file.

Linux Commands✓ Tested
CStrings & byte buffers

Split simple delimited text in place

C: strtok inserts terminators into a writable buffer and skips repeated delimiter characters.

C✓ Tested
Arduino / CGetting Started

Store a small unsigned value

Arduino / C: Store a small unsigned value on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
CDynamic memory & ownership

Allocate an independent copy of a C string

C: Include one extra byte for the terminating null character.

C✓ Tested
PowerShellFile operations & integrity

Calculate a file’s SHA-256 digest

PowerShell: Get-FileHash hashes bytes without requiring the caller to load the whole file.

PowerShell✓ Tested
JavaEncoding & structured values

Calculate a SHA-256 content digest

Java: Hash UTF-8 bytes and format the result as lowercase hexadecimal.

Java✓ Tested
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
CSmall algorithms & bit operations

Compute a simple XOR checksum

C: XOR all payload bytes into one byte to demonstrate a basic error-detection field.

C✓ Tested
C++Text validation & parsing

Convert ASCII text to lowercase safely

C++: Cast each byte to unsigned char before using the cctype function.

C++✓ Tested