hash_file
Version, currently master branch1 version
- master branchlatestApr 6, 2022
github.com/mehmetc/hash_file
a hash that persists its data onto disk
0 stars
1 dependent
License: MIT
Installation
# Add this to your shard.yml
dependencies:
hash_file:
github: mehmetc/hash_file
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.3.2- License
- MIT
- Author
- Mehmet Celik
Dependencies
This version declares no dependencies.
README
hash_file
A hash function that persists its data onto disk. Useful when creating a simple cache
Installation
Add this to your application's shard.yml:
dependencies:
hash_file:
github: mehmetc/hash_file
Usage
require "hash_file"
HashFile.config({"base_dir" => "/tmp/cache"})
HashFile["hello"] = "world"
HashFile.store("foo", "bar", {"expire" => (Time.now + 5.minute)}) #5 minutes
puts HashFile["hello"]
HashFile.fetch("foo") unless HashFile.expired?("foo")
HashFile.delete("hello")
HashFile.clear
Contributing
- Fork it (https://github.com/your-github-user/hash_file/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- mehmetc Mehmet Celik - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Apr 6, 2022
- Crystal
1.3.2- Indexed
- yes
Dependents
Repository
github.com/mehmetc/hash_file
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1