26 unstable releases (6 breaking)

0.7.5 Nov 8, 2024
0.7.2 Sep 27, 2024
0.6.8 Jul 31, 2024
0.5.0 Mar 5, 2024
0.3.1 Nov 10, 2023

#1586 in Cryptography

Download history 4/week @ 2024-08-11 1/week @ 2024-08-18 2/week @ 2024-08-25 172/week @ 2024-09-01 4/week @ 2024-09-08 186/week @ 2024-09-15 240/week @ 2024-09-22 46/week @ 2024-09-29 10/week @ 2024-10-06 148/week @ 2024-10-13 128/week @ 2024-10-20 16/week @ 2024-10-27 104/week @ 2024-11-03 24/week @ 2024-11-10 8/week @ 2024-11-17 1/week @ 2024-11-24

138 downloads per month
Used in nuts-archive

MIT license

71KB
921 lines

nuts-directory: Nuts backend implementation

Introduction

The nuts-directory crate implements a nuts backend where the blocks of the container are stored in a file hierarchy. Each block is identified by an id, which is basically a 16 byte random number.

When storing a block to disks the path to the file is derived from the id:

  1. The id is converted into a hex string.
  2. The path then would be: <first two chars>/<next two chars>/<remaining chars>

The header of the container is stored in the file 00/00/0000000000000000000000000000. Nuts backend implementation where the blocks of the container are stored in a file hierarchy.

Create a new backend instance

The CreateOptions type is used to create a new backend instance, which is passed to the Container::create method. You need at least a directory where the backend put its blocks. See the CreateOptions documentation for further options.

Open an existing backend

The OpenOptions type is used to open a backend instance, which is passed to the Container::open method. You need the directory where the backend put its blocks.

License

You can check out the full license here.

This project is licensed under the terms of the MIT license.

Dependencies

~0.1–7.5MB
~60K SLoC