44 "bytes"
55 "encoding/binary"
66 "fmt"
7+ "io"
78)
89
910// Version represents which version of the varsig specification was used
@@ -18,7 +19,7 @@ const (
1819
1920// DecodeFunc is a function that parses the varsig representing a specific
2021// signing algorithm.
21- type DecodeFunc func (BytesReader ) (Varsig , error )
22+ type DecodeFunc func (io. ByteReader ) (Varsig , error )
2223
2324// Registry contains a mapping between known signing algorithms and
2425// functions that can parse varsigs for that signing algorithm.
@@ -53,7 +54,7 @@ func (rs Registry) Decode(data []byte) (Varsig, error) {
5354
5455// DecodeStream converts data read from the provided io.Reader into one
5556// of the registered Varsig types.
56- func (rs Registry ) DecodeStream (r BytesReader ) (Varsig , error ) {
57+ func (rs Registry ) DecodeStream (r io. ByteReader ) (Varsig , error ) {
5758 pre , err := binary .ReadUvarint (r )
5859 if err != nil {
5960 return nil , fmt .Errorf ("%w: %w" , ErrBadPrefix , err )
@@ -80,7 +81,7 @@ func (rs Registry) DecodeStream(r BytesReader) (Varsig, error) {
8081 return decodeFunc (r )
8182}
8283
83- func (rs Registry ) decodeVersAndAlgo (r BytesReader ) (Version , Algorithm , error ) {
84+ func (rs Registry ) decodeVersAndAlgo (r io. ByteReader ) (Version , Algorithm , error ) {
8485 vers , err := binary .ReadUvarint (r )
8586 if err != nil {
8687 return Version (vers ), 0 , err
0 commit comments