Created
June 16, 2018 00:25
-
-
Save R41D3NN/61b0b1028e6351298be40c3ed0147902 to your computer and use it in GitHub Desktop.
Converts base64 strings.
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
Function Convert-ToBase64String | |
{ | |
Param( | |
[String] $Text | |
) | |
$Local:Bytes = [System.Text.Encoding]::Unicode.GetBytes($Text) | |
$Local:EncodedText = [Convert]::ToBase64String($Local:Bytes) | |
Return $Local:EncodedText | |
} | |
Function Convert-FromBase64String | |
{ | |
Param( | |
[String] $Base64Text | |
) | |
$Local:DecodedText = [System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($Base64Text)) | |
Return $Local:DecodedText | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment