Skip to content

Conversation

@austoonz
Copy link
Owner

Summary

This PR migrates additional Base64 functions to use the Rust convert_core library for consistency and improved error handling.

Changes

  • ConvertFrom-Base64ToByteArray: Replaced .NET System.Convert.FromBase64String with Rust base64_to_bytes
  • ConvertFrom-Base64: Replaced .NET System.Convert and System.Text.Encoding with Rust base64_to_string and base64_to_bytes
  • Updated tests to expect Rust error messages instead of .NET error messages
  • Applied cargo fmt formatting to encoding.rs

Related

Builds on #15 (ConvertFrom-ByteArrayToString)

Adds new function to convert byte arrays to strings with encoding support.
Supports ASCII, BigEndianUnicode, Default, Unicode, UTF32, and UTF8 encodings.
This is the inverse operation of ConvertFrom-StringToByteArray.

- Add bytes_to_string Rust FFI function with 17 tests
- Add ConvertFrom-ByteArrayToString PowerShell function with 43 Pester tests
- Add DllImport binding in RustInterop.ps1
- Add function documentation and update CHANGELOG
- Update ConvertFrom-StringToByteArray docs to reference inverse function
- Replace .NET System.Convert.FromBase64String with Rust base64_to_bytes
- Update ConvertFrom-Base64ToMemoryStream test for Rust error messages
- Replace .NET System.Convert and System.Text.Encoding with Rust base64_to_string and base64_to_bytes
- Update tests for Rust error messages
@austoonz austoonz merged commit 73974ad into main Jan 30, 2026
23 checks passed
@austoonz austoonz deleted the feature/issue-15-convertfrom-bytearraytostring branch January 30, 2026 03:11
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