Skip to content

Instantly share code, notes, and snippets.

@xjbeta
Created March 3, 2019 04:03
Show Gist options
  • Save xjbeta/893c0781c75ad4dccf373f4f755ac12f to your computer and use it in GitHub Desktop.
Save xjbeta/893c0781c75ad4dccf373f4f755ac12f to your computer and use it in GitHub Desktop.
Swift base64
import Cocoa
let emailEncode = "test@gmail.com".data(using: .utf8)?.base64EncodedString() ?? ""
let 📧 = String(data: Data(base64Encoded: "dGVzdEBnbWFpbC5jb20=")!, encoding: .utf8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment