Skip to content

Latest commit

 

History

History
83 lines (57 loc) · 1.33 KB

README.md

File metadata and controls

83 lines (57 loc) · 1.33 KB

base64url

Command-line base64url encoder / decoder

Installation

$ go get -u github.com/oscarayoy/base64url

Usage

$ base64url -h
Usage of base64url:
  -d	decodes input (default is to encode)
  -i string
    	input file or "-" for stdin (default "-")
  -o string
    	output file or "-" for stdout (default "-")

Encode from stdin:

$ echo "Hello, world" | base64url
SGVsbG8sIHdvcmxkCg

Decode from stdin:

$ echo "SGVsbG8sIHdvcmxkCg" | base64url -d
Hello, world

Encode to and from file:

$ base64url -i plain.txt -o b64.txt

Decode to and from file:

$ base64url -d -i b64.txt -o plain.txt

Development Setup

Install Goimports

This is used for code formatting.

$ go get -u golang.org/x/tools/cmd/goimports

Install Golint

This is used for code linting.

$ go get -u golang.org/x/lint/golint

Enable Commit Signing

The repository has been configured to enforce signature verification.

$ git config commit.gpgsign true
$ git config alias.tag 'tag -s'

Set Up the Git Pre-Commit Hook

This pre-commit hook makes sure all code is properly formatted and linted before it is committed.

$ cp githooks/pre-commit .git/hooks/pre-commit

Install goimports, golint and go vet support in your editor of choice as needed.