Module: | Base R Data Structures & Subsetting
Q7: Consider the following statements regarding raw vectors and hashing algorithms in R:
1. The raw data type is strictly utilized to store raw bytes, outputting elements to the console as two-digit hexadecimal strings.
2. In R 4.4.0, the md5sum() function was explicitly extended to compute hashes directly from raw vectors of bytes currently held in memory.
3. The R 4.4.0 release formally introduced the sha256sum() function to the tools package, enabling secure SHA-256 hashing for both files on disk and in-memory raw vectors.
Which of the above statements is/are correct?
2. In R 4.4.0, the md5sum() function was explicitly extended to compute hashes directly from raw vectors of bytes currently held in memory.
3. The R 4.4.0 release formally introduced the sha256sum() function to the tools package, enabling secure SHA-256 hashing for both files on disk and in-memory raw vectors.
Which of the above statements is/are correct?
✅ Correct Answer: D
🎯 Quick Answer:
D. All statements are factually correct.Hashing algorithms generate fixed-size string representations of data for absolute integrity verification.
Structural Breakdown: Raw vectors are initiated via the raw(length) command.
MD5 is a 128-bit hash, whereas the newer SHA-256 standard provides a vastly more secure 256-bit signature.
Historical/Related Context: Historically, R relied heavily on md5sum() for basic file integrity.
However, as MD5 became mathematically vulnerable to collision attacks, the R community demanded stronger native cryptographic standards without relying on external packages like digest.
Causal Reasoning: The implementation of sha256sum() and the memory-buffer extension for md5sum() in the R 4.4.0 update (April 2024) significantly modernized R's internal security toolkit, allowing developers to safely verify data integrity directly from RAM before committing data to disk.