lib/simplehasher.rb in simple-hasher-0.0.5 vs lib/simplehasher.rb in simple-hasher-0.0.6
- old
+ new
@@ -1,6 +1,8 @@
class SimpleHasher
+ require File.dirname(__FILE__) + 'simplehasher/railtie' if defined?(Rails)
+
def self.encode(id)
length = self.config.allowed_chars.length
while id > length -1
hash = self.config.allowed_chars[id % length,1].concat( hash || "" )