PowerShell
PowerShell
Base62 Encoding and Decoding
Demonstrates base62 encoding and decoding.Chilkat PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$bd = New-Object Chilkat.BinData
# Base62 encode.
$bd.AppendString("hello world","utf-8")
$base62_encoded = $bd.GetEncoded("base62")
$("hello world --> " + $base62_encoded)
# Output:
# hello world --> AAwf93rvy4aWQVw
# Base62 decode
$sb = New-Object Chilkat.StringBuilder
$sb.DecodeAndAppend("AAwf93rvy4aWQVw","base62","utf-8")
$("decoded: " + $sb.GetAsString())
# Output:
# decoded: hello world