-
Notifications
You must be signed in to change notification settings - Fork 10
Repo improvements #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Owner
|
Thanks Jake! :D |
austoonz
added a commit
that referenced
this pull request
Jan 30, 2026
- ConvertTo-Celsius and ConvertTo-Fahrenheit now accept -Precision (0-15) - Default remains 2 decimal places for practical use - Higher precision available for scientific calculations (e.g., absolute zero) - Rust returns full f64 precision, PowerShell handles rounding - Updated INCONSISTENCIES.md to mark item #5 as resolved
austoonz
added a commit
that referenced
this pull request
Jan 31, 2026
* Fix binary data handling in byte-to-string conversions (fixes #24) Add lenient mode for handling non-UTF8 binary data (e.g., certificates, images): - When no encoding is specified, use Latin-1 fallback for invalid UTF-8 bytes - When encoding is explicitly provided, use strict mode (throws on invalid) - Replace null bytes with Unicode replacement character (U+FFFD) for C string safety Rust changes: - Add bytes_to_string_lenient, base64_to_string_lenient, decompress_string_lenient FFI functions - Update convert_bytes_to_string_with_fallback to handle null byte replacement PowerShell changes: - Update ConvertFrom-ByteArrayToString, ConvertFrom-Base64ToString, ConvertFrom-CompressedByteArrayToString - Add DllImport declarations for lenient functions in RustInterop.ps1 This allows commands like 'Get-SecureBootUEFI db | ConvertFrom-ByteArrayToString' to work without throwing 'Invalid UTF-8 bytes' errors. * Remove default Encoding parameter values for future extensibility Move encoding defaults from parameter declarations to internal handling: - Allows detection of whether user explicitly specified an encoding - Enables future best-effort improvements when encoding is not provided - All functions now use internal 'if ([string]::IsNullOrEmpty(\)) { \ = ''UTF8'' }' Updated functions: - ConvertFrom-Base64, ConvertFrom-MemoryStream, ConvertFrom-MemoryStreamToString - ConvertFrom-MemoryStreamToSecureString, ConvertFrom-StringToBase64 - ConvertFrom-StringToByteArray, ConvertFrom-StringToCompressedByteArray - ConvertFrom-StringToMemoryStream, ConvertTo-Base64, ConvertTo-Hash - ConvertTo-HmacHash, ConvertTo-MemoryStream * docs: clarify lenient/strict encoding behavior for byte-to-string functions - Update ConvertFrom-ByteArrayToString help to explain UTF-8 with Latin-1 fallback when -Encoding not specified - Update ConvertFrom-Base64ToString help with same lenient/strict behavior documentation - Fix ConvertFrom-CompressedByteArrayToString incorrect synopsis (was backwards) and add encoding docs - Regenerate markdown documentation - Add INCONSISTENCIES.md tracking document for standardization work * fix: add error messages to URL functions for consistency url_encode and url_decode now call set_error() when input is null, matching the error handling pattern used by all other Rust functions. * refactor: remove duplicate convert_string_to_bytes from hash module hash.rs now uses crate::base64::convert_string_to_bytes() instead of maintaining its own copy of the encoding conversion logic. * Add -Precision parameter to temperature conversion functions - ConvertTo-Celsius and ConvertTo-Fahrenheit now accept -Precision (0-15) - Default remains 2 decimal places for practical use - Higher precision available for scientific calculations (e.g., absolute zero) - Rust returns full f64 precision, PowerShell handles rounding - Updated INCONSISTENCIES.md to mark item #5 as resolved * Standardize encoding conversions on Rust - Add compute_hmac_with_encoding for string input with encoding parameter - Add compute_hmac_bytes for direct byte array input (no encoding needed) - Remove unused compute_hmac function - Update ConvertTo-HmacHash to use new Rust functions - Update ConvertFrom-StringToMemoryStream to use Rust string_to_bytes - Fix bug: non-compress path now respects -Encoding parameter - Fix bug: GzipStream now properly closed - Update tests for correct behavior - Mark INCONSISTENCIES.md issue #4 as resolved * Fix encoding issues in ConvertFrom-ByteArrayToString tests - Replace Unicode arrow character with ASCII in test name - Use [char]::ConvertFromUtf32(0x1F30D) instead of literal emoji to avoid file encoding corruption issues * Various fixes and improvements - Update build.ps1 and RustInterop.ps1 - Fix compression.rs in Rust library - Update Base64 conversion functions - Fix ConvertTo-MemoryStream and RustInterop tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
This pull request adds basic generic improvements to this repository project.
Module builds without issue. Read the docs tested and verified in forked build.
Issue
N/A
Detailed Description of Changes
License
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.