GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lockblox/multihash: C++ Implementation of Multihash

BranchesTags
Open more actions menu

Latest commit

 

History

251 Commits
251 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
cmake
cmake
 
 
multihash
multihash
 
 
test
test
 
 
.clang-format
.clang-format
 
 
.clang-tidy
.clang-tidy
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.travis.yml
.travis.yml
 
 
CMakeLists.txt
CMakeLists.txt
 
 
Dockerfile
Dockerfile
 
 
Doxyfile
Doxyfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
appveyor.yml
appveyor.yml
 
 

Repository files navigation

multihash

Build Status Build Status Coverage Status

multihash implementation in c++.

Multihash is delivered as

  1. A library: libmultihash
  2. An executable: bin/multihash

Build

Building with Docker

The supplied dockerfile produces a reproducable build image which can be used to compile the source:

docker build -t lockblox/multihash multihash
docker run -it --rm -v multihash:/root/src lockblox/multihash 

Building Manually

Installing Prerequisites

Multihash requires some dependencies to be met before building, which are provided via vcpkg as follows:

 git clone https://github.com/lockblox/vcpkg.git \
 cd vcpkg \
 ./bootstrap-vcpkg.sh \
 ./vcpkg integrate install \
 ./vcpkg install gtest cryptopp ms-gsl varint

Building with CMake

Multihash uses cmake for builds. In order for cmake to find the required dependencies, the -DCMAKE_TOOLCHAIN_FILE option should be supplied, for example:

 cmake -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake" ../multihash
 cmake --build .

Usage

Algorithm

At the lowest level, there is the abstract type multihash::algorithm.

A multihash::algorithm defines the steps required to compute a hash from input data.

multihash::algorithm instances are created by a factory and each factory is registered under a unique hash code identifier.

auto code = multihash::code::sha3_256;
auto algorithm = multihash::algorithm::create(code);
auto buffer = std::string{"hello, world"};
algorithm->update(buffer);
auto result = std::string(256, '=');
algorithm->digest(result);

Function

A multihash::function is a hash functor which operates on iterator pairs.

auto multihash = multihash::function(code)(input.begin(), input.end());

Multihash

A multihash::multihash combines the hash code and multihash in a binary payload.

auto code = multihash.code();
auto multihash = multihash.multihash();

License

multihash is released under the MIT License.

About

C++ Implementation of Multihash

Resources

Readme
MIT license
Activity
Custom properties

Stars

9 stars

Watchers

3 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.