2017 © Pedro Peláez
 

library incremental-slugger

The slugging library used by Darkshare to create incremental slugs.

image

drksh/incremental-slugger

The slugging library used by Darkshare to create incremental slugs.

  • Thursday, August 31, 2017
  • by jstoone
  • Repository
  • 2 Watchers
  • 1 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

A solid slugger

I've been looking for slugging libraries which are able to create incremental slugs, I couldn't find anything that satisfied my needs, therefore I had to have a go at it., (*1)

Incremental slugs

These are best known for their sort nature in URL-shorteners. Let me give you an example of how they can work, (*2)

Let's say you have your own little URL-shortener, and each of the user submitted URL's have an id. Since base-10 limits you very quickly, character-wise, you might want to show id 81259151 as fUcod., (*3)

Usage

// Transform ID's to slugs.
Darkshare\Slugger::encode(1); // a
Darkshare\Slugger::encode(81259151); // fUcod

// Transform slugs to IDs.
Darkshare\Slugger::decode('a'); // 1
Darkshare\Slugger::decode('fUcod'); // 81259151

The Versions

31/08 2017

dev-master

9999999-dev

The slugging library used by Darkshare to create incremental slugs.

  Sources   Download

MIT

The Requires

  • php ^7.0|^7.1

 

The Development Requires

by Jakob Steinn

31/08 2017

dev-develop

dev-develop

The slugging library used by Darkshare to create incremental slugs.

  Sources   Download

MIT

The Requires

  • php ^7.0|^7.1

 

The Development Requires

by Jakob Steinn

31/08 2017

v1.0

1.0.0.0

The slugging library used by Darkshare to create incremental slugs.

  Sources   Download

MIT

The Requires

  • php ^7.0|^7.1

 

The Development Requires

by Jakob Steinn

20/11 2016

v0.1.0

0.1.0.0

The slugging library used by Darkshare to create incremental slugs.

  Sources   Download

MIT

The Requires

  • php ^7.0|^7.1

 

The Development Requires

by Jakob Steinn