New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

has_random_token

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

has_random_token

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Has Random Token

Has Random Token is a helper to create random tokens for model attributes in Ruby on Rails. The tokens generated are Base64 strings.

Install

gem install 'has_random_token'

or in your Gemfile

gem 'has_random_token' and then bundle

Usage

class Session < ActiveRecord::Base
	has_random_token
end

or

class Session < ActiveRecord::Base
	has_random_token attribute: :code, length: 64, unique: true
end

Configuration

  • The default column name is token. You can customize it by setting the attribute option.
  • By default, it doesn't verify the token is unique. In order to verify uniqueness, you can set the unique option to true.
  • The default token length is 32 characters. You can customize it by setting the length option.

FAQs

Package last updated on 11 Mar 2015

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