#storage #secure #nuts #file-path #hex-string

bin+lib nuts-directory

A backend implementation for nuts

12 releases (5 breaking)

new 0.6.0 May 16, 2024
0.5.0 Mar 5, 2024
0.4.3 Jan 22, 2024
0.3.2 Dec 5, 2023
0.1.1 Oct 2, 2023

#1738 in Cryptography

Download history 28/week @ 2024-01-18 211/week @ 2024-02-15 22/week @ 2024-02-22 127/week @ 2024-02-29 32/week @ 2024-03-07 14/week @ 2024-03-14 53/week @ 2024-03-28 25/week @ 2024-04-04

987 downloads per month
Used in nuts-archive

MIT license

66KB
843 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.2–9.5MB
~68K SLoC