Skip to content

Instantly share code, notes, and snippets.

@melkael
Created February 1, 2019 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melkael/4ff06836c77682d100289b2f876e16e2 to your computer and use it in GitHub Desktop.
Save melkael/4ff06836c77682d100289b2f876e16e2 to your computer and use it in GitHub Desktop.
package main
import "fmt"
import b64 "encoding/base64"
import hex "encoding/hex"
func hex_to_base64(hex_s string) string {
bytes, _ := hex.DecodeString(hex_s)
sEnc := b64.StdEncoding.EncodeToString(bytes)
return sEnc
}
func main() {
fmt.Println("challenge 1 : ", hex_to_base64("49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment