Skip to content

Commit

Permalink
Updated files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajshastri committed Oct 14, 2023
1 parent 6d2b0c7 commit 0a4ebd0
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 39 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/checksum_builder-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Checksum builder Linux

on:
push:
# branches:
# - main
# branches:
# - main
tags:
- '*'

Expand All @@ -17,10 +17,10 @@ jobs:
token: ${{ secrets.GH_PAT || github.token }}
- name: Setup Go
uses: actions/setup-go@v4
with :
with:
go-version: 'stable'
check-latest: true
- name: compile
check-latest: true
- name: compile
run: go build checksum.go
- name: Test
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/checksum_builder-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Checksum builder Windows

on:
push:
# branches:
# - main
# branches:
# - main
tags:
- '*'

Expand All @@ -17,10 +17,10 @@ jobs:
token: ${{ secrets.GH_PAT || github.token }}
- name: Setup Go
uses: actions/setup-go@v4
with :
with:
go-version: 'stable'
check-latest: true
- name: compile
check-latest: true
- name: compile
run: go build checksum.go
- name: Test
run: |
Expand Down
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 25 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
# Checksum
Prints checksum of the file based on Golang's crypto library and golang.org/x/crypto

Prints checksum of the file based on Golang's crypto library and golang.org/x/crypto

## Usage
### Usage: checksum [OPTION] ... [FILE]
Prints checksum of the file based on Golang's crypto library and golang.org/x/crypto.
Defaults to SHA2-256 (256-bit) checksums.

### Usage: checksum [OPTION] ... [FILE]

Prints checksum of the file based on Golang's crypto library and golang.org/x/crypto.
Defaults to SHA2-256 (256-bit) checksums.

## Options:
`-h, --help` - Displays this help command <br />
`-c, --checksum` - Checksum algorithm. Defaults to SHA2 256-bit checksum.
`-f, --file` - Does a checksum on the file defined. Defaults to SHA2 256-bit checksum.

`-h, --help` - Displays this help command <br />
`-c, --checksum` - Checksum algorithm. Defaults to SHA2 256-bit checksum.
`-f, --file` - Does a checksum on the file defined. Defaults to SHA2 256-bit checksum.

## Available checksums:
md4 - Performs MD4 hash algorithm as defined in RFC 1320.
md5 - Performs MD5 hash algorithm as defined in RFC 1321.
sha1 - Performs SHA-1 hash algorithm as defined in RFC 3174.
sha2-224 / sha224 - Performs SHA2-224 hash algorithms as defined in FIPS 180-4.
sha2-256 / sha256 - Performs SHA2-256 hash algorithms as defined in FIPS 180-4.
sha2-384 / sha384 - Performs SHA2-384 hash algorithms as defined in FIPS 180-4.
sha2-512 / sha512 - Performs SHA2-512 hash algorithms as defined in FIPS 180-4.
sha3-224 - Performs SHA3-224 hash algorithms as defined in FIPS 180-4.
sha3-256 - Performs SHA3-256 hash algorithms as defined in FIPS 180-4.
sha3-384 - Performs SHA3-384 hash algorithms as defined in FIPS 180-4.
sha3-512 - Performs SHA3-512 hash algorithms as defined in FIPS 180-4.
sha2-512_224 / sha512_224 - Performs SHA2-512 hash algorithms as defined in FIPS 180-4.
sha2-512_256 / sha512_256 - Performs SHA2-512 hash algorithms as defined in FIPS 180-4.

md4 - Performs MD4 hash algorithm as defined in RFC 1320.
md5 - Performs MD5 hash algorithm as defined in RFC 1321.
sha1 - Performs SHA-1 hash algorithm as defined in RFC 3174.
sha2-224 / sha224 - Performs SHA2-224 hash algorithms as defined in FIPS 180-4.
sha2-256 / sha256 - Performs SHA2-256 hash algorithms as defined in FIPS 180-4.
sha2-384 / sha384 - Performs SHA2-384 hash algorithms as defined in FIPS 180-4.
sha2-512 / sha512 - Performs SHA2-512 hash algorithms as defined in FIPS 180-4.
sha3-224 - Performs SHA3-224 hash algorithms as defined in FIPS 180-4.
sha3-256 - Performs SHA3-256 hash algorithms as defined in FIPS 180-4.
sha3-384 - Performs SHA3-384 hash algorithms as defined in FIPS 180-4.
sha3-512 - Performs SHA3-512 hash algorithms as defined in FIPS 180-4.
sha2-512_224 / sha512_224 - Performs SHA2-512 hash algorithms as defined in FIPS 180-4.
sha2-512_256 / sha512_256 - Performs SHA2-512 hash algorithms as defined in FIPS 180-4.
10 changes: 6 additions & 4 deletions checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
"strings"
)

const VERSION = "0.0.1"

var (
sumPtr string
fileName string
Expand All @@ -34,10 +36,10 @@ func help(exitCode int) {
fmt.Println(" md4 - Performs MD4 hash algorithm as defined in RFC 1320.")
fmt.Println(" md5 - Performs MD5 hash algorithm as defined in RFC 1321.")
fmt.Println(" sha1 - Performs SHA-1 hash algorithm as defined in RFC 3174.")
fmt.Println(" sha2-224 / sha224 - Performs SHA2-224 hash algorithms as defined in FIPS 180-4.")
fmt.Println(" sha2-256 / sha256 - Performs SHA2-256 hash algorithms as defined in FIPS 180-4.")
fmt.Println(" sha2-384 / sha384 - Performs SHA2-384 hash algorithms as defined in FIPS 180-4.")
fmt.Println(" sha2-512 / sha512 - Performs SHA2-512 hash algorithms as defined in FIPS 180-4.")
fmt.Println(" sha224 / sha2-224 - Performs SHA2-224 hash algorithms as defined in FIPS 180-4.")
fmt.Println(" sha256 / sha2-256 - Performs SHA2-256 hash algorithms as defined in FIPS 180-4.")
fmt.Println(" sha384 / sha2-384 - Performs SHA2-384 hash algorithms as defined in FIPS 180-4.")
fmt.Println(" sha512 / sha2-512 - Performs SHA2-512 hash algorithms as defined in FIPS 180-4.")
fmt.Println(" sha3-224 - Performs SHA3-224 hash algorithms as defined in FIPS 180-4.")
fmt.Println(" sha3-256 - Performs SHA3-256 hash algorithms as defined in FIPS 180-4.")
fmt.Println(" sha3-384 - Performs SHA3-384 hash algorithms as defined in FIPS 180-4.")
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module checksum

go 1.21

require golang.org/x/crypto v0.13.0
require golang.org/x/crypto v0.14.0

require golang.org/x/sys v0.12.0 // indirect
require golang.org/x/sys v0.13.0 // indirect
7 changes: 4 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

0 comments on commit 0a4ebd0

Please sign in to comment.