<commit_before>[![Gem Version](https://badge.fury.io/rb/attr_digest.svg)](https://badge.fury.io/rb/attr_digest)
[![Build Status](https://travis-ci.org/brightcommerce/attr_digest.svg?branch=rails5)](https://travis-ci.org/brightcommerce/attr_digest)
[![codecov.io](https://codecov.io/github/brightcommerce/attr_digest/coverage.svg?branch=rails5)](https://codecov.io/github/brightcommerce/attr_digest?branch=master)
[![HitCount](https://hitt.herokuapp.com/brightcommerce/attr_digest.svg)](https://github.com/brightcommerce/attr_digest)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues)

# AttrDigest

[**AttrDigest**](https://github.com/brightcommerce/attr_digest) provides functionality to store a hash digest of an attribute using [Argon2](https://github.com/P-H-C/phc-winner-argon2).

Argon2 is a password-hashing function that summarizes the state of the art in the design of memory-hard functions and can be used to hash passwords for credential storage, key derivation, or other applications. It  is the official winner and recommendation of the [Password Hashing Competition (PHC)](https://password-hashing.net) which ran between 2013 and 2015.

This Gem uses the [Ruby Argon2 Gem](https://github.com/technion/ruby-argon2) which provides FFI bindings, and a simplified interface, to the Argon2 algorithm.

**AttrDigest** provides similar functionality to Rails `has_secure_password`, but permits any number attributes to be hashed in a model, and obviously you're not limited to just the `password` attribute.

## Installation

To install add the following line to your `Gemfile`:

``` ruby
gem 'attr_digest',
```

And run `bundle install`.

## Dependencies

Runtime:
- activerecord (>= 4.2.2, ~> 5.0.0)
- activesupport (>= 4.2.2, ~> 5.0.0)
- argon2 (~> 1.1.0)

Development/Test:<commit_msg>Fix branch pointers in badges.<commit_after>[![Gem Version](https://badge.fury.io/rb/attr_digest.svg)](https://badge.fury.io/rb/attr_digest)
[![Build Status](https://travis-ci.org/brightcommerce/attr_digest.svg?branch=master)](https://travis-ci.org/brightcommerce/attr_digest)
[![codecov.io](https://codecov.io/github/brightcommerce/attr_digest/coverage.svg?branch=master)](https://codecov.io/github/brightcommerce/attr_digest?branch=master)
[![HitCount](https://hitt.herokuapp.com/brightcommerce/attr_digest.svg)](https://github.com/brightcommerce/attr_digest)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/dwyl/esta/issues)

# AttrDigest

[**AttrDigest**](https://github.com/brightcommerce/attr_digest) provides functionality to store a hash digest of an attribute using [Argon2](https://github.com/P-H-C/phc-winner-argon2).

Argon2 is a password-hashing function that summarizes the state of the art in the design of memory-hard functions and can be used to hash passwords for credential storage, key derivation, or other applications. It  is the official winner and recommendation of the [Password Hashing Competition (PHC)](https://password-hashing.net) which ran between 2013 and 2015.

This Gem uses the [Ruby Argon2 Gem](https://github.com/technion/ruby-argon2) which provides FFI bindings, and a simplified interface, to the Argon2 algorithm.

**AttrDigest** provides similar functionality to Rails `has_secure_password`, but permits any number attributes to be hashed in a model, and obviously you're not limited to just the `password` attribute.

## Installation

To install add the following line to your `Gemfile`:

``` ruby
gem 'attr_digest',
```

And run `bundle install`.

## Dependencies

Runtime:
- activerecord (>= 4.2.2, ~> 5.0.0)
- activesupport (>= 4.2.2, ~> 5.0.0)
- argon2 (~> 1.1.0)

Development/Test:
{'fraction_non_alphanumeric': 0.13735829158977064, 'fraction_numerical': 0.01634590034273662, 'mean_word_length': 5.518900343642612, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 28, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '433778', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1173, 'n_words': 301}