use std::str;
      use base64::{encode, decode};
      
      fn main() -> Result<()> {
        let hello = "hello rustaceans";
        let encoded = encode(hello);
        println!("origin: {}", str::from_utf8(hello)?);
        println!("base64 encoded: {}", encoded);
        Ok(())
      }
      
      Rust language logo

      Encode to base64

      Codiga's Rust Recipes

      from string to base64

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.