Coder Social home page Coder Social logo

gckdir's People

Contributors

kemokemo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

gckdir's Issues

failed to create the hash value of large files

gckdir/lib/hash.go

Lines 96 to 103 in 1fb158b

bytes, err := ioutil.ReadFile(path)
if err != nil {
log.Println("ReadFile error.", err)
c <- result{Data: data, Error: err}
return
}
hash := sha256.Sum256(bytes)
data.HashValue = hex.EncodeToString(hash[:])

The ioutil.ReadFile() is easy to use, but this read all of the files in memory.
If you have any large files (ex. several gigabytes), the function to create hash value will be very slowly.
In some cases, gckdir application crashes. ๐Ÿ˜ข

Let's fix it!

CDN free!

In the report format, the CDN of the bootstrap is used.
But I use only a few styles. I will embed the necessary css in the template. ๐Ÿ˜ƒ

add --no-hv option

I will add an option that is useful when checking only the structure of files and directories.
Ignore the difference in hash value between individual files when this option is set to On.

--no-hv (no hash verification) option

I got inspiration from git's --no-ff option.

"compare" to "verify"

The functions of this tool are not compared, and it is verified whether it is the same as the correct answer data. Therefore, make the following changes.

  • Change subcommand from "compare" to "verify"
  • If verification is successful, nothing is output (Rule of Silence)

The contents of the generated hash list are not sorted

Although the verification results are sorted, the list generated by the generate command is not sorted.
For this reason, the difference becomes very difficult to understand, for example, when changing the hash list and committing to the git version management system.

Names conflict when reports are collectively output by script etc.

The result report is output in a fixed format called Result_{YYYYMMDD}-{hhmmss}.html.
Therefore, when executing consecutively as below, there were times when file names conflicted and it was not possible to create a report.

$ ./gckdir ver --report a.json path/to/targetA
$ ./gckdir ver --report b.json path/to/targetB

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.