Creates a batch of short URLs in advance and returns them as an array.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
MIT-LICENSE
README.md
gem-public_cert.pem
short-url-creator.gemspec

README.md

Introducing the Short URL Creator gem

require 'short-url-creator'

surl = ShortUrlCreator.new

# generate 10,061 unique ids
surl.generate(10061) do |a|
  a.slice!(0,61)      # slices out the single characters
  a.length #=> 8611   # remaining ids after sanitisation  
end
surl.save