Skip to content

Instantly share code, notes, and snippets.

@tehprofessor
tehprofessor / error_pages.rb
Created May 14, 2012 16:53 — forked from corny/error_pages.rb
Custom error pages
#
# Usage:
# class ApplicationController < ActionController::Base
# include ErrorPages
# end
#
require 'active_support/core_ext/array/extract_options'
module ErrorPages
extend ActiveSupport::Concern
import scala.util._
import java.security.SecureRandom
import java.security.MessageDigest
/*
* Generates a Bearer Token with a length of
* 32 characters (MD5) or 64 characters (SHA-256) according to the
* specification RFC6750 (http://tools.ietf.org/html/rfc6750)
*
* Uniqueness obtained by by hashing system time combined with a