一、加密

  1. //base64加密
  2. encodeString := base64.StdEncoding.EncodeToString([]byte("字符串"))

二、解密

  1. //base64解密
  2. encodeString := base64.StdEncoding.EncodeToString([]byte("字符串"))
  3. decodeBytes, _ := base64.StdEncoding.DecodeString(encodeString)