diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 3c94c19..0000000 --- a/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -indent_style = tab -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = false diff --git a/.gitignore b/.gitignore index 9ef8dad..8c1b98a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,7 @@ * !*/ +!*.go +!*.mod +!*.sum +!*.md !.gitignore -!.editorconfig -!go.sum -!go.mod -!README.md -!LICENSE -!*.go \ No newline at end of file diff --git a/Benchmarks_test.go b/Benchmarks_test.go index 3ae16fc..742a524 100644 --- a/Benchmarks_test.go +++ b/Benchmarks_test.go @@ -8,7 +8,6 @@ import ( ) func BenchmarkSize(b *testing.B) { - b.Run(" 7", bench(7)) b.Run(" 8", bench(8)) b.Run(" 16", bench(16)) b.Run(" 17", bench(17)) diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 40d5bcd..0000000 --- a/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) 2023 Eduard Urbach - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 43e3370..ebaedb4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,13 @@ This is a non-cryptographic hash (aka checksum) to verify data integrity. -## API +## Installation + +```shell +go get git.akyoto.dev/go/hash +``` + +## Usage ```go sum := hash.Bytes(data) @@ -10,10 +16,19 @@ sum := hash.Bytes(data) You can use `strconv.FormatUint(sum, 16)` to get a string in hexadecimal format. +## Tests + +``` +PASS: TestTiny +PASS: TestZeroed +PASS: TestSameByte +PASS: TestDistribution +coverage: 100.0% of statements +``` + ## Benchmarks ``` -BenchmarkSize/___7-12 144845362 8.282 ns/op BenchmarkSize/___8-12 318401613 3.779 ns/op BenchmarkSize/__16-12 273568264 4.400 ns/op BenchmarkSize/__17-12 222336567 5.425 ns/op @@ -27,4 +42,12 @@ BenchmarkSize/_512-12 22842753 54.89 ns/op BenchmarkSize/1024-12 8913499 134.5 ns/op BenchmarkSize/2048-12 4074927 294.5 ns/op BenchmarkSize/4096-12 1952067 625.4 ns/op -``` \ No newline at end of file +``` + +## License + +Please see the [license documentation](https://akyoto.dev/license). + +## Copyright + +© 2023 Eduard Urbach diff --git a/go.mod b/go.mod index 595f0fe..ab15395 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module git.akyoto.dev/go/hash -go 1.20 +go 1.21