Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Data securely stored in urls.
tag: v0.2.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
README.markdown
Rakefile
VERSION
url_store.gemspec

README.markdown

Data securely stored in urls.

  • url-save output
  • short codes through GZip
  • serializing through :marshal :yaml
  • hashing through DSS DSS1 MD2 MD4 MD5 MDC2 RIPEMD160 SHA SHA1 SHA224 SHA256 SHA384 SHA512

Install

  • As gem: sudo gem install url_store
  • As Rails plugin: script/plugin install git://github.com/grosser/url_store.git

Usage

# config (e.g environment.rb)
UrlStore.secret = 'adadasd2adsdasd4ads4eas4dea4dsea4sd'

# View:
<%= link_to 'paid', :controller=>:payments, :action=>:paid, :data=>UrlStore.encode(:id=>1, :status=>'paid') %>

# Controller:
if data = UrlStore.decode(params[:data])
  Payment.find(data[:id]).update_attribute(:status, data[:status])
else
  raise 'FRAUD!'
end

Options

UrlStore.secret = 'something random'
UrlStore.hasher = 'MD5' # default: 'SHA1'
UrlStore.serializer = :yaml # default: :marshal

Author

Michael Grosser
grosser.michael@gmail.com
Hereby placed under public domain, do what you want, just do not hold me accountable...

Something went wrong with that request. Please try again.