|
|
@@ -53,10 +53,9 @@ func hexToCompact(hex []byte) []byte {
|
|
|
|
|
|
func compactToHex(compact []byte) []byte {
|
|
|
base := keybytesToHex(compact)
|
|
|
- base = base[:len(base)-1]
|
|
|
- // apply terminator flag
|
|
|
- if base[0] >= 2 {
|
|
|
- base = append(base, 16)
|
|
|
+ // delete terminator flag
|
|
|
+ if base[0] < 2 {
|
|
|
+ base = base[:len(base)-1]
|
|
|
}
|
|
|
// apply odd flag
|
|
|
chop := 2 - base[0]&1
|