-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exp: plumbling/hasher, Add ObjectHasher
and ImmutableHash
#920
base: master
Are you sure you want to change the base?
Commits on Nov 10, 2023
-
plumbing: format/config, Add ErrInvalidObjectFormat
Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 13f3057 - Browse repository at this point
Copy the full SHA 13f3057View commit details -
plumbing: hash, Add SHA1 and SHA256 constants
Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 7f458e0 - Browse repository at this point
Copy the full SHA 7f458e0View commit details -
plumbing: hash, Add ErrUnsupportedHashFunction
Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 764559b - Browse repository at this point
Copy the full SHA 764559bView commit details -
plumbing: hash, Add hash.FromObjectFormat
The support for SHA256 will require the mapping between ObjectFormat and the correct hash.Hash to be used. Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 6d5a79c - Browse repository at this point
Copy the full SHA 6d5a79cView commit details -
exp: Introduces an experimental package
The new exp package will hold only experimental code, which may eventually make its way to other parts of go-git. One example of how it would be used is to support the breaking up of changes required for things like SHA256. That feature would require several packages to be changed, and introducing such changes to plumbing in one go would be too disruptive. The new changes would now be staged in the new package, and as they mature they would be either moved into their target destination (e.g. plumbing/hash), or removed if no longer needed. As per caveat on the documentation, this package API may introduce breaking changes to its subpackages in minor go-git releases, therefore beware when depending on them. Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Configuration menu - View commit details
-
Copy full SHA for c4a9ef1 - Browse repository at this point
Copy the full SHA c4a9ef1View commit details -
exp: plumbling/hasher, Add ObjectHasher and ImmutableHash
The introduction of both new types are a stepping stone to enable SHA256 support concurrently - without the need for a build tag. ImmutableHash provides a way to represent varied sized hashes (for SHA1 or SHA256) with a single type, while keeping similar performance of the existing plumbing.Hash. The names were picked in order to provide a clearer distinction on what they do. ImmutableHash is the result of a hash operation and can't be changed once calculated. ObjectHasher, adds the Git object header before a normal hash operation that hash.Hash or plumbing/hash.Hash do. The performance results shows that SHA1 operations could be slower, however for SHA256 it can be over 3 times faster: ~Hasher/hasher-sha1-100B-16 2202226 574.7 ns/op 174.00 MB/s 272 B/op 7 allocs/op ~Hasher/objecthash-sha1-100B-16 1511851 772.6 ns/op 129.43 MB/s 272 B/op 9 allocs/op ~Hasher/objecthash-sha256-100B-16 5057584 247.4 ns/op 404.21 MB/s 96 B/op 7 allocs/op ~Hasher/hasher-sha1-5000B-16 96476 12523 ns/op 399.25 MB/s 5536 B/op 7 allocs/op ~Hasher/objecthash-sha1-5000B-16 105376 10983 ns/op 455.27 MB/s 272 B/op 9 allocs/op ~Hasher/objecthash-sha256-5000B-16 420741 2828 ns/op 1767.77 MB/s 96 B/op 7 allocs/op ~HashFromHex/hasher-parse-sha1-valid-16 23243548 64.65 ns/op 618.69 MB/s 48 B/op 1 allocs/op ~HashFromHex/objecthash-fromhex-sha1-valid-16 18120699 79.62 ns/op 502.36 MB/s 72 B/op 2 allocs/op ~HashFromHex/objecthash-fromhex-sha256-valid-16 8969871 124.2 ns/op 515.22 MB/s 96 B/op 2 allocs/op Signed-off-by: Paulo Gomes <paulo.gomes@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 328f9ea - Browse repository at this point
Copy the full SHA 328f9eaView commit details