Base64String To String

Base64String To String

open System
open System.Text

let RemoveCRLF (str : string) =
    str.Replace("\n", "").Replace("\r", "").Replace(" ", "")

let Base64ToString (base64 : string) =
    base64
    |> RemoveCRLF
    |> Convert.FromBase64String 
    |> ASCIIEncoding.Default.GetString 
    |> Console.WriteLine

[<EntryPoint>]
let main argv = 
    if argv.Length <> 0 then
        argv.[0]
        |> Base64ToString
    else
        "Base64String To String"
        |> Console.WriteLine
        while true do
            Console.ReadLine()
            |> Base64ToString
    0

 

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注