Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/teamcfadvance/irreversibleurlshortener

Provides functions for generating an irreversible key of variable length to be used as a shortened URL variable.
https://github.com/teamcfadvance/irreversibleurlshortener

Last synced: about 2 months ago
JSON representation

Provides functions for generating an irreversible key of variable length to be used as a shortened URL variable.

Awesome Lists containing this project

README

        

IrreversibleURLShortener
========================

Provides functions for generating an irreversible key of variable length to be used as a shortened URL variable. In response to a question in the [TACFUG google group](https://groups.google.com/forum/#!msg/tacfug/d4mFhPLzFUU/ezbeMV539XkJ), I have created this project to demonstrate a few ways in which to generate shortened URL variables to use in place of longer (e.g. CreateUUID()) variables.

This package relies on having a database table with a column that stores the generated keys produced by this code. As such, this package includes two CFC's:

* Datasource.cfc
* IrreversibleURLShortener.cfc

The Datasource.cfc is consumed (required) by the IrreversibleURLShortener.cfc.

--------------

To use, first initialize the datasource model/bean and the IrrversibleURLShortener component:

```ColdFusion

```

-----------

Then, call the method passing in the [table] and [column] that stores the key to check the existence of in the database, optionally specifying the length of the generated key (6 chars by default) using one of the available methods (hash, aplha, alphanum or numeric, 'hash' by default):

```ColdFusion

```

**OR**

```ColdFusion

```

**OR**

```ColdFusion

```

**OR**

```ColdFusion

```

------------

**DEMO**

This package now also includes a demonstration index.cfm, an Application.cfc where default values are defined, and a MySQL script to generate the demo table used.

[You can also view a live demo of this code](http://css.dvdmenubacks.com/IUSDemo/)