This commit is contained in:
ston1th 2023-03-21 01:00:13 +01:00
commit 05a68df896
15 changed files with 158 additions and 135 deletions

View file

@ -12,6 +12,13 @@ var b32raw = base32.StdEncoding.WithPadding(base32.NoPadding)
type Encoding int
const (
Hex Encoding = iota
Base32
Base64
Base64URL
)
func (e Encoding) String() string {
switch e {
case Base32:
@ -59,10 +66,3 @@ func EncodingFromString(e string) Encoding {
}
return Hex
}
const (
Hex Encoding = iota
Base32
Base64
Base64URL
)

View file

@ -17,7 +17,6 @@ var NameRe = regexp.MustCompile(nameReReverse)
type Key struct {
ID string
Name string
Created int64
Size int
Encoding Encoding
Type Type

View file

@ -10,6 +10,11 @@ import (
type Type int
const (
Plain Type = iota
Shamir
)
func (t Type) String() string {
switch t {
case Shamir:
@ -48,8 +53,3 @@ func TypeFromString(t string) Type {
}
return Plain
}
const (
Plain Type = iota
Shamir
)