mirror of
https://github.com/FiloSottile/age.git
synced 2026-01-04 19:33:55 +00:00
internal/format: switch to 64 columns of standard Base64
Now that we don't use Base64 in keys, let's just go back to the standard alphabet. Still in the spirit of reducing weirdness, use the PEM column count, so we can also reuse the lineWriter for the PEM armor. See https://groups.google.com/d/msg/age-dev/UAjkvLoCr9I/l4Q1h3OPAgAJ.
This commit is contained in:
committed by
Filippo Valsorda
parent
9a84e437b1
commit
b142e0fd01
@@ -29,7 +29,7 @@ type Recipient struct {
|
||||
Body []byte
|
||||
}
|
||||
|
||||
var b64 = base64.RawURLEncoding.Strict()
|
||||
var b64 = base64.RawStdEncoding.Strict()
|
||||
|
||||
func DecodeString(s string) ([]byte, error) {
|
||||
// CR and LF are ignored by DecodeString, but we don't want any malleability.
|
||||
@@ -41,7 +41,7 @@ func DecodeString(s string) ([]byte, error) {
|
||||
|
||||
var EncodeToString = b64.EncodeToString
|
||||
|
||||
const columnsPerLine = 56
|
||||
const columnsPerLine = 64
|
||||
const bytesPerLine = columnsPerLine / 4 * 3
|
||||
|
||||
const intro = "This is a file encrypted with age-tool.com, version 1\n"
|
||||
|
||||
Reference in New Issue
Block a user