Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

digestible_attributes

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

digestible_attributes

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

DigestibleAttributes

This plugin lets you compute a hash digest based on the values of a set of attributes, and store it on your model.

Usage

Options

  • fields - list of attribute fields to be digested
  • algorithm - which hash algorithm to use for digest (defaults to :MD5)
  • digest_column - where to store the digest (defaults to *ALGORITHM*_digest; i.e. md5_digest)

Quick start

If you have a model with fields foo, bar, baz, simply add the following to your model file:

digestible_attributes fields: [:foo, :bar, :baz]

Supported hash algorithms

This gem uses OpenSSL::Digest to compute digests. The currently supported algorithms are:

  • :MD2
  • :MD4
  • :MD5
  • :MDC2
  • :RIPEMD160
  • :SHA1
  • :SHA224
  • :SHA256
  • :SHA384
  • :SHA512

Installation

Add this line to your application's Gemfile:

gem 'digestible_attributes'

And then execute:

$ bundle

Or install it yourself as:

$ gem install digestible_attributes

Things to come

  • Generators
  • RSpec Matchers
  • Any ideas you might have?

Contributing

For any suggested changes, you can fork the repo, make your changes, and then open up a PR. Please be sure to include a helpful commit message / explanation for your changes.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 02 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc