0.0
No commit activity in last 3 years
No release in over 3 years
shorten a uuid to a shorter representation and back
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0
>= 0
 Project Readme

uuid_shortner

shorten a uuid to a shorter representation and back

I include it in rails controllers to convert uuids to short ones for UI representation and stretch them to standard uuid for use in the backend.

class ProductController < ActionController::Base
    include UuidShortner::GuidDecoder
    include UuidShortner::GuidEncoder

    def create
      #Backend
      uuid = create_product

      redirect_to "/product/#{compress(uuid)}"
    end

    def index
      product = get_product stretch(params[short_product_uuid])
    end
end