#hash #hash-table #memoization #hash-set #hash-map #precompute

no-std prehash

A crate for storing values with precomputed hashes

6 releases (1 stable)

1.0.0 Jan 25, 2023
0.3.3 Jul 23, 2021
0.3.2 Dec 9, 2020
0.2.1 Dec 6, 2020
0.1.0 Dec 6, 2020

#909 in Data structures

Download history 5930/week @ 2023-11-27 4945/week @ 2023-12-04 4277/week @ 2023-12-11 4092/week @ 2023-12-18 5287/week @ 2023-12-25 4549/week @ 2024-01-01 5078/week @ 2024-01-08 5830/week @ 2024-01-15 5586/week @ 2024-01-22 7390/week @ 2024-01-29 3727/week @ 2024-02-05 1285/week @ 2024-02-12 3395/week @ 2024-02-19 5373/week @ 2024-02-26 4869/week @ 2024-03-04 1494/week @ 2024-03-11

15,599 downloads per month

MPL-2.0-no-copyleft-exception

22KB
169 lines

prehash

The prehash crate provides the type Prehashed, which stores a value of any type along with a precomputed hash. This makes it possible to avoid computing large expensive hashes many times, for example when searching for a particular value in a variety of hash tables.

The crate also defines an extremely simple Hasher, Passthru, which is tailor built for use with Prehashed, as well as some convenience functions.

Documentation

Inline rustdoc documentation is available. A mirror of this documentation is available at https://docs.rs/prehash.

Contributing

prehash is developed at GitLab.

Reasonable performance, correctness, documentation, and ease-of-use contributions are always welcome. Bug reports and feature suggestions are accepted through GitLab.

Pull Requests

Please ensure pull requests match the existing coding style and are formatted with rustfmt.

Spelling and grammatical errors are considered bugs, so please use spell-checking facilities prior to submitting a contribution.

Contribution Agreement

By contributing, you grant all contributors a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, relicense, sublicense, and distribute your contributions.

Additionally, you affirm that you are legally entitled to grant such license and that your contributions are not and will not become patent-encumbered. In the event that you discover that such affirmation was made in error, you agree to post notice of such error in a conspicuous place (such as a GitLab Issue) within three days.

License

prehash is licensed under the terms of the Mozilla Public License, v. 2.0. All Source Code Forms are "Incompatible With Secondary Licenses", as described in §3.3 of the license.

The corresponding SPDX license identifier is MPL-2.0-no-copyleft-exception.

Copyright

This document is Copyright (C) 2020 Nathan Sharp.

Permission is granted to reproduce this document, in any form, free of charge. The source code form of this document is subject to the terms of the Mozilla Public License, v. 2.0.

No runtime deps

Features