Skip to content

Commit

Permalink
Updated imports and license.
Browse files Browse the repository at this point in the history
  • Loading branch information
vault-thirteen committed Dec 21, 2023
1 parent 7fae78d commit b478d04
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 58 deletions.
21 changes: 0 additions & 21 deletions License

This file was deleted.

24 changes: 12 additions & 12 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ Use the `build.bat` script included with the source code.

## Why ?

Even at this moment hash tools for Windows operating system are very poor.
The set of utilities which comes with Git for Windows contains hash tools for
Even at this moment hash tools for _Windows_ operating system are very poor.
The set of utilities which comes with _Git for Windows_ contains hash tools for
MD5 and SHA256, but support for good old CRC32 is absent. Moreover, there are
some bugs in the tools included with GNU Core Utilities embedded into Git for
Windows.
some bugs in the tools included with _GNU Core Utilities_ embedded into _Git for
Windows_.

## Additional Notes

Expand All @@ -69,29 +69,29 @@ Checker reads lines with standard line end (CR+LF).
If you do not agree with it, you should read the following article:
https://en.wikipedia.org/wiki/Newline

Note that Go language is sly when it comes to reading text lines.
Note that _Go_ language is sly when it comes to reading text lines.
It provides methods to write OS-specific text, but it does not provide any
tools to read OS-specific text lines. Instead, Go languages gives freedom of
tools to read OS-specific text lines. Instead, _Go_ languages gives freedom of
choice.

Imagine, how would you parse text which has new lines. Would you read it until
the LF (Line Feed) character as Unix does ? Or would you read it until the CR
(Carriage Return) symbol as Macintosh does ? What would you do if you
the LF (Line Feed) character as _Unix_ does ? Or would you read it until the CR
(Carriage Return) symbol as _Macintosh_ does ? What would you do if you
occasionally met a combination of them ? Would you see them as two lines, one
of which is empty, or should they be concatenated ? Too many questions arise
since the good old standard was broken by some sly "inventors" and "optimizers".

Historically Carriage Return means the return of carriage. That is it.

Historically Line Feed means movement of the carriage to the next line down the text.
That is it.
Historically Line Feed means movement of the carriage to the next line down the
text. That is it.

Further "inventions" in this field only lead to anarchy.

If you want to "invent" a new 'New Line' symbol, create a new standalone
Unicode symbol, do not break the history of the humankind, the ASCII standard.
Unicode symbol, do not break the history of the humankind, the _ASCII_ standard.

### ASCII
ASCII Code Chart, 1967.
_ASCII_ Code Chart, 1967.

![ASCII Code Chart](assets/img/USASCII_code_chart_1967.png)
10 changes: 5 additions & 5 deletions cmd/hasher/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
ht "github.com/vault-thirteen/Hasher/pkg/Models/HashType"
ot "github.com/vault-thirteen/Hasher/pkg/Models/ObjectType"
"github.com/vault-thirteen/Hasher/pkg/hash"
ae "github.com/vault-thirteen/auxie/errors"
"github.com/vault-thirteen/auxie/number"
"github.com/vault-thirteen/auxie/reader"
"github.com/vault-thirteen/errorz"
)

const (
Expand Down Expand Up @@ -70,7 +70,7 @@ func checkCRC32HashesInFile(filePath string) (err error) {
defer func() {
derr := f.Close()
if derr != nil {
err = errorz.Combine(err, derr)
err = ae.Combine(err, derr)
}
}()

Expand Down Expand Up @@ -160,7 +160,7 @@ func checkMD5HashesInFile(filePath string) (err error) {
defer func() {
derr := f.Close()
if derr != nil {
err = errorz.Combine(err, derr)
err = ae.Combine(err, derr)
}
}()

Expand Down Expand Up @@ -250,7 +250,7 @@ func checkSHA256HashesInFile(filePath string) (err error) {
defer func() {
derr := f.Close()
if derr != nil {
err = errorz.Combine(err, derr)
err = ae.Combine(err, derr)
}
}()

Expand Down Expand Up @@ -318,7 +318,7 @@ func checkFileSizeHashesInFile(filePath string) (err error) {
defer func() {
derr := f.Close()
if derr != nil {
err = errorz.Combine(err, derr)
err = ae.Combine(err, derr)
}
}()

Expand Down
2 changes: 1 addition & 1 deletion cmd/hasher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

a "github.com/vault-thirteen/Hasher/pkg/Models/Action"
cla "github.com/vault-thirteen/Hasher/pkg/Models/CommandLineArguments"
ver "github.com/vault-thirteen/Versioneer"
ver "github.com/vault-thirteen/auxie/Versioneer"
)

const UsageHint = `Usage:
Expand Down
7 changes: 1 addition & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ module github.com/vault-thirteen/Hasher

go 1.20

require (
github.com/vault-thirteen/Versioneer v0.10.1
github.com/vault-thirteen/auxie v0.15.2
github.com/vault-thirteen/errorz v1.2.0
)
require github.com/vault-thirteen/auxie v0.18.1

require (
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/vault-thirteen/VCS v0.6.1 // indirect
)
11 changes: 2 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,5 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/vault-thirteen/VCS v0.6.1 h1:F2KZ9yEs4qLnf07LDiLNmY/kbtX+354ULVML3zNUspc=
github.com/vault-thirteen/VCS v0.6.1/go.mod h1:/QbKAlyw+hjlpW7415kPCQQ0lM/+BgQMI3wlakeHByQ=
github.com/vault-thirteen/Versioneer v0.10.1 h1:P4XYrQ0hzltu9hWSgDUTs/fUgAmtrNnKdWPvOwzVPXs=
github.com/vault-thirteen/Versioneer v0.10.1/go.mod h1:dibpTEx4sgVhGm2hld/R64m1cEGZmtfHj+K1cvxTKAA=
github.com/vault-thirteen/auxie v0.15.2 h1:BElKHMiCJ+jOBwbmq6/OryOg91FyFjFhyAayhs2ZNDo=
github.com/vault-thirteen/auxie v0.15.2/go.mod h1:svYzCFdNE9W2xf5uuT9SqX4iFDqN+NjdLlvsBLpDV8Q=
github.com/vault-thirteen/errorz v1.2.0 h1:i2w9yHqYrsqOWyVPVMeEfv1TIATULW8PxnRGhySeyZ8=
github.com/vault-thirteen/errorz v1.2.0/go.mod h1:+1mqgPir0fmbjS/MmElLOouoNycetmwtYdmmbjQI9PI=
github.com/vault-thirteen/tester v1.2.0 h1:eUfPZqS5bXbQ+6Zed9EceN3ddsOBBMZoU0y+/eJV8cc=
github.com/vault-thirteen/auxie v0.18.1 h1:fEXXFl5nbmCE7r1RuxfcRaj8ecFZcTSmIheP1D4/3AE=
github.com/vault-thirteen/auxie v0.18.1/go.mod h1:Lux+qciKoin+mNgTLVvsczeJ1KcLqfM9PGPqBeAZbDY=
8 changes: 4 additions & 4 deletions pkg/hash/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io"
"os"

"github.com/vault-thirteen/errorz"
ae "github.com/vault-thirteen/auxie/errors"
)

const (
Expand All @@ -23,7 +23,7 @@ func GetFileHashCRC32(filePath string) (sum uint32, err error) {
defer func() {
derr := f.Close()
if derr != nil {
err = errorz.Combine(err, derr)
err = ae.Combine(err, derr)
}
}()

Expand Down Expand Up @@ -66,7 +66,7 @@ func GetFileHashMD5(filePath string) (sum []byte, err error) {
defer func() {
derr := f.Close()
if derr != nil {
err = errorz.Combine(err, derr)
err = ae.Combine(err, derr)
}
}()

Expand Down Expand Up @@ -109,7 +109,7 @@ func GetFileHashSHA256(filePath string) (sum []byte, err error) {
defer func() {
derr := f.Close()
if derr != nil {
err = errorz.Combine(err, derr)
err = ae.Combine(err, derr)
}
}()

Expand Down

0 comments on commit b478d04

Please sign in to comment.