mirror of
https://github.com/restic/restic.git
synced 2025-08-11 06:47:45 +00:00
Restructure backend
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"sync"
|
||||
)
|
||||
|
||||
// IDSize contains the size of an ID, in bytes.
|
||||
@@ -14,6 +15,8 @@ const IDSize = sha256.Size
|
||||
// References content within a repository.
|
||||
type ID []byte
|
||||
|
||||
var idPool = sync.Pool{New: func() interface{} { return ID(make([]byte, IDSize)) }}
|
||||
|
||||
// ParseID converts the given string to an ID.
|
||||
func ParseID(s string) (ID, error) {
|
||||
b, err := hex.DecodeString(s)
|
||||
|
Reference in New Issue
Block a user