Skip to content

Latest commit

 

History

History
40 lines (33 loc) · 912 Bytes

readme.md

File metadata and controls

40 lines (33 loc) · 912 Bytes

hashdir

Build Status Crates.io Crates.io

Generate a cryptographic view of a directory's contents.

Usage

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
    }
  ]
}