Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 3a07395

Browse files
committed
Add buzhash to parsers list
License: MIT Signed-off-by: Jakub Sztandera <[email protected]>
1 parent 9d6ad92 commit 3a07395

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

parse.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ var (
1414
)
1515

1616
// FromString returns a Splitter depending on the given string:
17-
// it supports "default" (""), "size-{size}", "rabin", "rabin-{blocksize}" and
18-
// "rabin-{min}-{avg}-{max}".
17+
// it supports "default" (""), "size-{size}", "rabin", "rabin-{blocksize}",
18+
// "rabin-{min}-{avg}-{max}" and "buzhash".
1919
func FromString(r io.Reader, chunker string) (Splitter, error) {
2020
switch {
2121
case chunker == "" || chunker == "default":
@@ -34,6 +34,9 @@ func FromString(r io.Reader, chunker string) (Splitter, error) {
3434
case strings.HasPrefix(chunker, "rabin"):
3535
return parseRabinString(r, chunker)
3636

37+
case chunker == "buzhash":
38+
return NewBuzhash(r), nil
39+
3740
default:
3841
return nil, fmt.Errorf("unrecognized chunker option: %s", chunker)
3942
}

0 commit comments

Comments
 (0)