2019-07-11 18:37:38 +02:00
|
|
|
---
|
|
|
|
title: 'encoding/base64'
|
|
|
|
---
|
2019-07-10 01:54:15 +02:00
|
|
|
|
2020-03-26 21:26:03 +01:00
|
|
|
base64 defines base64 encoding & decoding functions,
|
|
|
|
often used to represent binary as text.
|
2020-03-23 21:18:06 +01:00
|
|
|
|
|
|
|
## Index
|
|
|
|
|
|
|
|
|
|
|
|
* [def <b>decode</b>(src,encoding="standard") string](#def-ibase64ibdecodeb)
|
|
|
|
* [def <b>encode</b>(src,encoding="standard") string](#def-ibase64ibencodeb)
|
|
|
|
|
|
|
|
|
2019-07-10 01:54:15 +02:00
|
|
|
## Functions
|
|
|
|
|
2019-07-11 18:45:42 +02:00
|
|
|
|
2020-03-23 21:18:06 +01:00
|
|
|
#### def <i>base64</i>.<b>decode</b>
|
2019-07-11 18:37:38 +02:00
|
|
|
```go
|
2020-03-23 21:18:06 +01:00
|
|
|
base64.decode(src,encoding="standard") string
|
2019-07-11 18:37:38 +02:00
|
|
|
```
|
2019-07-10 01:54:15 +02:00
|
|
|
parse base64 input, giving back the plain string representation
|
|
|
|
|
2020-03-23 21:18:06 +01:00
|
|
|
###### Arguments
|
2019-07-10 01:54:15 +02:00
|
|
|
|
|
|
|
| name | type | description |
|
|
|
|
|------|------|-------------|
|
2020-03-23 21:18:06 +01:00
|
|
|
| `src` | `string` | source string of base64-encoded text |
|
|
|
|
| `encoding` | `string` | optional. string to set decoding dialect. allowed values are: standard,standard_raw,url,url_raw |
|
2019-07-10 01:54:15 +02:00
|
|
|
|
|
|
|
|
2019-07-11 18:45:42 +02:00
|
|
|
|
2020-03-23 21:18:06 +01:00
|
|
|
#### def <i>base64</i>.<b>encode</b>
|
2019-07-11 18:37:38 +02:00
|
|
|
```go
|
2020-03-23 21:18:06 +01:00
|
|
|
base64.encode(src,encoding="standard") string
|
2019-07-11 18:37:38 +02:00
|
|
|
```
|
2019-07-10 01:54:15 +02:00
|
|
|
return the base64 encoding of src
|
|
|
|
|
2020-03-23 21:18:06 +01:00
|
|
|
###### Arguments
|
2019-07-10 01:54:15 +02:00
|
|
|
|
|
|
|
| name | type | description |
|
|
|
|
|------|------|-------------|
|
2020-03-23 21:18:06 +01:00
|
|
|
| `src` | `string` | source string to encode to base64 |
|
|
|
|
| `encoding` | `string` | optional. string to set encoding dialect. allowed values are: standard,standard_raw,url,url_raw |
|
2019-07-11 18:37:38 +02:00
|
|
|
|
2019-07-10 01:54:15 +02:00
|
|
|
|
|
|
|
|