Skip to content

Conversation

@maqi
Copy link
Member

@maqi maqi commented Oct 22, 2025

  1. Created a new public helper function: streaming_encrypt_datamaps_from_file
    This function performs the core encryption logic but returns both the original and shrunk data maps without storing any chunks. It's memory-efficient and useful for scenarios where you need the data maps for analysis or want to handle chunk storage separately.
    Key features:
  • Returns a tuple (DataMap, DataMap) - original map and shrunk map
  • Uses placeholder chunk store functions to avoid memory overhead
  • Maintains the same encryption logic as the original function
  • Includes comprehensive documentation with examples
  1. Refactored the original streaming_encrypt_from_file function
    The original function now uses a shared core implementation (streaming_encrypt_core) that can optionally store chunks. This eliminates code duplication while maintaining the same public API and functionality.
  2. Added comprehensive unit tests

@maqi maqi force-pushed the get_datamaps_from_file branch from 4d7a1b2 to 9660607 Compare October 22, 2025 10:31
@maqi maqi force-pushed the get_datamaps_from_file branch from 9660607 to a174628 Compare October 22, 2025 10:35
Copy link
Member

@dirvine dirvine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @maqi I do feel we need an API overhaul in this crate with perhaps a new cleaner API and deprecate old API over time.

@maqi maqi merged commit 302009d into maidsafe:master Oct 22, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants