hash_animal(x, n_adj = 2) hash_raw_animal(x, n_adj = 2) hash_obj_animal(x, n_adj = 2, serialize_version = 2)
NAentries will have an
Number of adjectives to use. It must be between 0 and 3.
Workspace format version to use, see
A data frame with columns
hash: the hash value, a string.
words: list column with the adjectives and the animal name in a character vector.
hash_obj_animal() return a list
hash: the hash value, a string,
`words: the adjectives and the animal name in a character vector.
It uses the first 13 hexadecimal characters (out of the 32) of the MD5 hash of the input, and converts them into an adjective-animal form to create a human readable hash.
hash_animals() uses 1748 animal names and
8946 different adjectives. The number of
different hashes you can get for different values of
|size of the hash table space|
The list of adjectives and animals comes from the ids package, and in turn from https://github.com/a-type/adjective-adjective-animal, and from https://gfycat.com.
hash_raw_anima() calculates the adjective-animal hash of
the bytes of a raw vector.
hash_obj_animal() calculates the adjective-animal hash of
an R object. The object is serialized into a binary vector first.
hash_animal(c("foo", "bar")) #> hash words #> 1 sacrilegious diet lion sacrileg.... #> 2 uncitizenly agricultural amethystgemclam uncitize.... # if you increase `n_adj`, the shorter hash is a suffix of the longer: hash_animal("cli package", 0)$hash #>  "pullet" hash_animal("cli package", 1)$hash #>  "pastyfaced pullet" hash_animal("cli package", 2)$hash #>  "pregnant pastyfaced pullet" hash_animal("cli package", 3)$hash #>  "unwelcome pregnant pastyfaced pullet"