Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/47ng/hashdir
Generate a cryptographic view of a directory's contents
https://github.com/47ng/hashdir
hash-tree rust
Last synced: 4 days ago
JSON representation
Generate a cryptographic view of a directory's contents
- Host: GitHub
- URL: https://github.com/47ng/hashdir
- Owner: 47ng
- License: mit
- Created: 2019-02-20T08:50:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-02-21T20:16:10.000Z (over 5 years ago)
- Last Synced: 2024-10-31T11:34:28.294Z (18 days ago)
- Topics: hash-tree, rust
- Language: Rust
- Size: 33.2 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# hashdir
[![Build Status](https://travis-ci.com/47ng/hashdir.svg?branch=master)](https://travis-ci.com/47ng/hashdir)
[![Crates.io](https://img.shields.io/crates/v/hashdir.svg)](https://crates.io/crates/hashdir)
[![Crates.io](https://img.shields.io/crates/l/hashdir.svg)](LICENSE)Generate a cryptographic view of a directory's contents.
## Usage
```rust
use hashdir::DirNode;fn main() {
let path = std::env::current_dir().unwrap();
let node = DirNode::from_path(&path, &path).unwrap();
println!("{:#?}", node);
}
```JSON Output (with `serde_json`):
```
{
"path": "./",
"hash": "QZxKfmJir+ZeG3K2vNxQGgcSHjhsCroJuRGNZUth0HA=",
"children": [
{
"path": "./lib.rs",
"hash": "X65gIOpFCSJzOZTlKoSlPp2Zg02F8n6c6nYopAOXHcc=",
"size": 3157
},
{
"path": "./flat.json",
"hash": "NAKMmbFrkytNFmsGz8pHuugiBY14DnjWGyBNwkUNR7A=",
"size": 382
}
]
}
```