Skip to content

Commit

Permalink
streamline DESCRIPTION
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed May 14, 2024
1 parent d4d0cd3 commit f515bee
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 36 deletions.
15 changes: 5 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@ Type: Package
Title: Cryptographic Hash and Extendable-Output Functions
Version: 0.5.0.9000
Description: Fast and memory-efficient streaming hash functions. Performs direct
hashing of strings, raw bytes, and files potentially larger than memory, as
well as hashing in-memory objects through R's serialization mechanism,
without requiring allocation of the serialized object. Implementations
include the SHA-256, SHA-3 and 'Keccak' cryptographic hash functions,
SHAKE256 extendable-output function (XOF), and 'SipHash' pseudo-random
function. The SHA-3 Secure Hash Standard was published by the National
Institute of Standards and Technology (NIST) in 2015 at
<doi:10.6028/NIST.FIPS.202>. The SHA-256 Secure Hash Standard was published
by NIST in 2002 at
<https://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf>.
hashing of strings and raw vectors. Stream hashes files potentially larger
than memory, as well as in-memory objects through R's serialization
mechanism. Implementations include the SHA-256, SHA-3 and 'Keccak'
cryptographic hash functions, SHAKE256 extendable-output function (XOF), and
'SipHash' pseudo-random function.
Authors@R:
c(person(given = "Charlie",
family = "Gao",
Expand Down
10 changes: 5 additions & 5 deletions R/base.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#' secretbase: Cryptographic Hash and Extendable-Output Functions
#'
#' Fast and memory-efficient streaming hash functions. Performs direct hashing
#' of strings, raw bytes, and files potentially larger than memory, as well
#' as hashing in-memory objects through R's serialization mechanism, without
#' requiring allocation of the serialized object. Implementations include
#' the SHA-256, SHA-3 and Keccak cryptographic hash functions, SHAKE256
#' extendable-output function (XOF), and 'SipHash' pseudo-random function.
#' of strings and raw vectors. Stream hashes files potentially larger than
#' memory, as well as in-memory objects through R's serialization mechanism.
#' Implementations include the SHA-256, SHA-3 and 'Keccak' cryptographic
#' hash functions, SHAKE256 extendable-output function (XOF), and 'SipHash'
#' pseudo-random function.
#'
#' @encoding UTF-8
#' @author Charlie Gao \email{charlie.gao@@shikokuchuo.net}
Expand Down
15 changes: 9 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ knitr::opts_chunk$set(
[![DOI](https://zenodo.org/badge/745691432.svg)](https://zenodo.org/doi/10.5281/zenodo.10553139)
<!-- badges: end -->

Fast and memory-efficient streaming hash functions. Performs direct hashing of strings, raw bytes, and files potentially larger than memory, as well as hashing in-memory objects through R's serialization mechanism, without requiring allocation of the serialized object.
Fast and memory-efficient streaming hash functions. Performs direct hashing of strings and raw vectors. Stream hashes files potentially larger than memory, as well as in-memory objects through R's serialization mechanism.

Implementations include the SHA-256, SHA-3 and 'Keccak' cryptographic hash functions, SHAKE256 extendable-output function (XOF), and 'SipHash' pseudo-random function.

Expand Down Expand Up @@ -63,10 +63,13 @@ sha3("秘密の基地の中", bits = 512)
```

#### Hash arbitrary R objects
#### Hash strings and raw vectors

- Character strings and raw vectors (without attributes) are hashed 'as is'
- Other objects are hashed using memory-efficient 'streaming' serialization, without allocation of the serialized object
- Character strings and raw vectors are hashed directly (as per the above)

#### Stream hash R objects

- All other objects are stream hashed using R serialization (memory-efficient as performed without allocation of the serialized object)
- Portable as always uses R serialization version 3 big-endian representation, skipping headers (which contain R version and native encoding information)

```{r streaming}
Expand All @@ -75,9 +78,9 @@ sha3(data.frame(a = 1, b = 2), bits = 224)
sha3(NULL)
```

#### Hash files
#### Stream hash files

- Performed in a streaming fashion, accepting files larger than memory
- Files are read and hashed incrementally, accepting files larger than memory

```{r files}
file <- tempfile(); cat("secret base", file = file)
Expand Down
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ badge](https://shikokuchuo.r-universe.dev/badges/secretbase?color=e4723a)](https
<!-- badges: end -->

Fast and memory-efficient streaming hash functions. Performs direct
hashing of strings, raw bytes, and files potentially larger than memory,
as well as hashing in-memory objects through R’s serialization
mechanism, without requiring allocation of the serialized object.
hashing of strings and raw vectors. Stream hashes files potentially
larger than memory, as well as in-memory objects through R’s
serialization mechanism.

Implementations include the SHA-256, SHA-3 and ‘Keccak’ cryptographic
hash functions, SHAKE256 extendable-output function (XOF), and ‘SipHash’
Expand Down Expand Up @@ -80,12 +80,16 @@ sha3("秘密の基地の中", bits = 512)
#> [1] "e30cdc73f6575c40d55b5edc8eb4f97940f5ca491640b41612e02a05f3e59dd9c6c33f601d8d7a8e2ca0504b8c22f7bc69fa8f10d7c01aab392781ff4ae1e610"
```

#### Hash arbitrary R objects
#### Hash strings and raw vectors

- Character strings and raw vectors (without attributes) are hashed ‘as
is’
- Other objects are hashed using memory-efficient ‘streaming’
serialization, without allocation of the serialized object
- Character strings and raw vectors are hashed directly (as per the
above)

#### Stream hash R objects

- All other objects are stream hashed using R serialization
(memory-efficient as performed without allocation of the serialized
object)
- Portable as always uses R serialization version 3 big-endian
representation, skipping headers (which contain R version and native
encoding information)
Expand All @@ -98,9 +102,10 @@ sha3(NULL)
#> [1] "b3e37e4c5def1bfb2841b79ef8503b83d1fed46836b5b913d7c16de92966dcee"
```

#### Hash files
#### Stream hash files

- Performed in a streaming fashion, accepting files larger than memory
- Files are read and hashed incrementally, accepting files larger than
memory

``` r
file <- tempfile(); cat("secret base", file = file)
Expand Down
10 changes: 5 additions & 5 deletions man/secretbase-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f515bee

Please sign in to comment.