Refactor signer code into command and package
This commit is contained in:
parent
3a2578ae55
commit
38566f35ef
13 changed files with 476 additions and 276 deletions
|
|
@ -2,27 +2,6 @@ package datastructures
|
|||
|
||||
import "encoding/binary"
|
||||
|
||||
type Action uint8
|
||||
|
||||
const (
|
||||
ActionNul = Action(0)
|
||||
ActionSign = Action(1)
|
||||
ActionRevoke = Action(2)
|
||||
)
|
||||
|
||||
func (a Action) String() string {
|
||||
switch a {
|
||||
case ActionNul:
|
||||
return "NUL"
|
||||
case ActionSign:
|
||||
return "SIGN"
|
||||
case ActionRevoke:
|
||||
return "REVOKE"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
func encode24BitLength(data []byte) []byte {
|
||||
lengthBytes := make([]byte, 4)
|
||||
binary.BigEndian.PutUint32(lengthBytes, uint32(len(data)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue