Skip to content

GoLang package to assist base64 file encoding/decoding.

Notifications You must be signed in to change notification settings

RyanJeon/Base64Util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Base64Util

This is a GoLang package to assist base64 file encoding/decoding.

Installation

go get github.com/ryanjeon/Base64Util

Example

package main

import (
    "fmt"
    "os"
    Base64Enc "github.com/ryanjeon/Base64Util"
)

func main() {
    file, err := os.Open("clown.png")
    if err != nil {
        fmt.Println("error")
    }

    Base64 := Base64Enc.FileToBase64Url(file)
    fmt.Println(Base64) \\Prints a Base64Url String 
}

Base64Enc Methods

Encoding

  • FileToBase64(file *os.File): takes a pointer to a File and returns a base64 encoded string
  • FileToBase64Url(file *os.File): takes a pointer to a File and returns a base64url encoded string

Decoding

  • Base64ToByte(code string): takes a base64/base64url encoded string, and returns a corresponding byte array.

About

GoLang package to assist base64 file encoding/decoding.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages