Skip to content
⚡Fast filysystem fingerprinting using xxHash
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin make library & test Jul 22, 2019
.gitignore add goreleaser Jul 22, 2019
.goreleaser.yml add goreleaser Jul 22, 2019
.travis.yml make library & test Jul 22, 2019
LICENSE Create LICENSE Jul 23, 2019
README.md Add find-plus example Jul 24, 2019
go.mod make library & test Jul 22, 2019
go.sum make library & test Jul 22, 2019
xxhashdir.go Use io.Copy to avoid reading entire files into memory. Jul 23, 2019
xxhashdir_test.go Fixed test failure under Windows. Jul 23, 2019

README.md

xxhashdir

Build Status

Usage

this package does fast filesystem fingerprinting using xxHash

# instead of "find . -type f -exec xxhsum {} \+"
$ ./xxhashdir .
...
880788507839261490    README.md
11541949788444589007  .travis.yml
6467850080536788703   bin/xxhashdir.go
...

typical CLI use:

./xxhashdir dir > before
# modify fs
./xxhashdir dir > after
diff <(sort before) <(sort after) | sort -nk3

Speed

Times faster than find + exec. Digesting xcode-10.2 with >250K files:

Time Cmd
656 sec time find /Applications/Xcode.app -type f -exec xxhsum {} ; > xxhsum.txt
88 sec time find /Applications/Xcode.app -type f -exec xxhsum {} + > xxhsum.txt
45 sec time ./xxhashdir /Applications/Xcode.app > xxhsumdir.txt

Golang api

func Hashdir(root string, out chan Entry)

where

type Entry struct {
    Path   string
    Xxhash uint64
}
You can’t perform that action at this time.