https://github.com/hostari/hash_generator
Walk through a directory and generate SHA256 hashes of files
https://github.com/hostari/hash_generator
crystal sha256
Last synced: 10 months ago
JSON representation
Walk through a directory and generate SHA256 hashes of files
- Host: GitHub
- URL: https://github.com/hostari/hash_generator
- Owner: hostari
- License: mit
- Created: 2022-06-28T09:38:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T18:42:16.000Z (about 2 years ago)
- Last Synced: 2025-03-18T19:57:11.100Z (about 1 year ago)
- Topics: crystal, sha256
- Language: Crystal
- Homepage: https://hostari.github.io/hash_generator/
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hash_generator
The hash_generator builds a path for each file within a directory and generates the file's SHA256. This can be used to detect if the file contents have been updated.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
hash_generator:
github: hostari/hash_generator
```
2. Run `shards install`
## Usage
```crystal
require "hash_generator"
```
To generate the SHA256 for each files within a directory, pass in the path of the folder that you need to `walk` through:
```crystal
path = "./spec/support/sample_servers_list/sample_server2"
HashGenerator::DirectoryFile.new(path).get_hash
```
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [paula4230](https://github.com/paula4230) - creator
- [xaviablaza](https://github.com/xaviablaza) - maintainer