Skip to content

Instantly share code, notes, and snippets.

@mengzhuo
Created May 19, 2018 09:33
Show Gist options
  • Save mengzhuo/218d7f801045cf82e3f69780dd6cdaff to your computer and use it in GitHub Desktop.
Save mengzhuo/218d7f801045cf82e3f69780dd6cdaff to your computer and use it in GitHub Desktop.
decode nonstd base64
package main
import (
"encoding/base64"
"fmt"
)
var table = []byte{'v', 'w', 'x', 'r', 's', 't', 'u', 'o', 'p', 'q', '3', '4', '5', '6', '7', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'y', 'z', '0', '1',
'2', 'P', 'Q', 'R', 'S', 'T', 'K', 'L', 'M', 'N', 'O', 'Z', 'a', 'b', 'c', 'd', 'U', 'V', 'W', 'X', 'Y', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', '8', '9',
'+', '/'}
func main() {
str := "5rFf7E2K6rqN7Hpiyush7E6S5fJg6rsi5NBf6NGT5rs="
data, _ := base64.NewEncoding(string(table)).DecodeString(str)
fmt.Println("%s", data)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment