github.com/ndau/noms@v1.0.5/go/hash/base32.go (about)

     1  // Copyright 2016 Attic Labs, Inc. All rights reserved.
     2  // Licensed under the Apache License, version 2.0:
     3  // http://www.apache.org/licenses/LICENSE-2.0
     4  
     5  package hash
     6  
     7  import "encoding/base32"
     8  
     9  var encoding = base32.NewEncoding("0123456789abcdefghijklmnopqrstuv")
    10  
    11  func encode(data []byte) string {
    12  	return encoding.EncodeToString(data)
    13  }
    14  
    15  func decode(s string) []byte {
    16  	slice, _ := encoding.DecodeString(s)
    17  	return slice
    18  }