{"id":21028537,"url":"https://github.com/dirkschumacher/blake3","last_synced_at":"2025-05-15T10:33:26.840Z","repository":{"id":145906339,"uuid":"233224545","full_name":"dirkschumacher/blake3","owner":"dirkschumacher","description":"BLAKE3 Cryptographic Hash Function in R","archived":false,"fork":false,"pushed_at":"2020-01-13T09:00:26.000Z","size":37,"stargazers_count":12,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T02:07:33.115Z","etag":null,"topics":["blake3","cryptography","hashing","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dirkschumacher.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-11T11:57:30.000Z","updated_at":"2025-03-22T10:50:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"322d0141-d37c-4379-8cb0-d4406ee37c53","html_url":"https://github.com/dirkschumacher/blake3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkschumacher%2Fblake3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkschumacher%2Fblake3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkschumacher%2Fblake3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkschumacher%2Fblake3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirkschumacher","download_url":"https://codeload.github.com/dirkschumacher/blake3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254323308,"owners_count":22051765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blake3","cryptography","hashing","r"],"created_at":"2024-11-19T11:56:06.388Z","updated_at":"2025-05-15T10:33:26.831Z","avatar_url":"https://github.com/dirkschumacher.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n# blake3\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n[![Travis build status](https://travis-ci.org/dirkschumacher/blake3.svg?branch=master)](https://travis-ci.org/dirkschumacher/blake3)\n[![Codecov test coverage](https://codecov.io/gh/dirkschumacher/blake3/branch/master/graph/badge.svg)](https://codecov.io/gh/dirkschumacher/blake3?branch=master)\n[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/dirkschumacher/blake3?branch=master\u0026svg=true)](https://ci.appveyor.com/project/dirkschumacher/blake3)\n\u003c!-- badges: end --\u003e\n\n`blake3` is an interface to the [BLAKE3](https://github.com/BLAKE3-team/BLAKE3) cryptographic hash function.\n\nTo quote blake3's readme:\n\n\u003e BLAKE3 is a cryptographic hash function that is:\n\u003e \n\u003e * Much faster than MD5, SHA-1, SHA-2, SHA-3, and BLAKE2.\n\u003e * Secure, unlike MD5 and SHA-1. And secure against length extension, unlike SHA-2.\n\u003e * Highly parallelizable across any number of threads and SIMD lanes, because it's a Merkle \u003e tree on the inside.\n\u003e * Capable of verified streaming and incremental updates, again because it's a Merkle tree.\n\u003e * A PRF, MAC, KDF, and XOF, as well as a regular hash.\n\u003e * One algorithm with no variants, which is fast on x86-64 and also on smaller architectures.\n\n\u003e *BLAKE3 is not a password hashing algorithm, because it's designed to be fast, whereas password hashing should not be fast. If you hash passwords to store the hashes or if you derive keys from passwords, we recommend Argon2.*\n\nIf you want to store passwords in R, please also take a look at [sodium::password_store](https://download.libsodium.org/doc/password_hashing/default_phf).\n\n## Installation\n\n``` r\nremotes::install_github(\"dirkschumacher/blake3\")\n```\n\nAlso make sure to have a very recent rust compiler. The best way to install the rust toolchain is to use [rustup](https://rustup.rs/).\n\n## API\n\nIt is still a very early version of the package. The api currently just has one function to hash `RAW` vectors with an optional 32 byte `RAW` key parameter.\n\n## Example\n\n```{r example}\nlibrary(blake3)\n\ninput \u003c- \"This is a string\"\nhash \u003c- blake3_hash_raw(charToRaw(input))\n(sodium::bin2hex(hash))\n\n```\n\n\n```{r}\n# you can also hash arbitrary R objects by serializing it first\ninput \u003c- serialize(LETTERS, NULL, version = 2)\nhash \u003c- blake3_hash_raw(input)\n(sodium::bin2hex(hash))\n```\n\n```{r}\n# keyed hashes are also supported\nkey \u003c- blake3_hash_raw(charToRaw(\"test\"))\ninput \u003c- serialize(LETTERS, NULL, version = 2)\nhash \u003c- blake3_hash_raw(input, key)\n(sodium::bin2hex(hash))\n```\n\n\n## Benchmark\nTo get an idea about the speed we hash a random string of 1 million characters and compare it to the `openssl` implementation of `sha1`, `sha2` and `md5`.\n```{r}\nlibrary(openssl)\nset.seed(42)\ninput \u003c- charToRaw(paste0(sample(LETTERS, 1e6, replace = TRUE), collapse = \"\"))\nmicrobenchmark::microbenchmark(\n  md5 = md5(input),\n  sha1 = sha1(input),\n  sha2 = sha2(input),\n  blake3 = blake3_hash_raw(input),\n  times = 1000\n)\n```\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirkschumacher%2Fblake3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirkschumacher%2Fblake3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirkschumacher%2Fblake3/lists"}