2017 © Pedro Peláez
 

library key62

Generating a unique short key from the number.

image

ngubin/key62

Generating a unique short key from the number.

  • Thursday, May 11, 2017
  • by Labiis
  • Repository
  • 0 Watchers
  • 0 Stars
  • 2,267 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

The repository is abandoned. Use https://github.com/ngubin/key-n instead!, (*1)


Key62

Generating a unique short key from the number., (*2)

A simple class for converting a number into a string key and back. You can use to shorten long numbers to unique keys., (*3)

Latest Version Total Downloads, (*4)

Example Usage

Creating a key from a number:

You can only encode an integer greater than or equal to zero., (*5)

``` php use Key62\Key62;, (*6)

$key62 = new Key62(); $key = $key62->encode(100000);, (*7)


#### Set your own character set to create keys and the minimum number of characters in the key: If you change the minimum length of the key when encoding, then do not forget to set it with the reverse decryption of the key. ``` php use Key62\Key62; $characters = 'wWpJbH8nIDed1Evq5OcToF2ZuXsayz7RrtP490ixSKC3GM6gYkNVhBUQmLlfAj'; $length = 4; $key62 = new Key62($characters, $length); $key = $key62->encode(100000);

Getting the number from the key:

You can decode the key if all of its characters are in the class set., (*8)

``` php use Key62\Key62;, (*9)

$key62 = new Key62(); $number = $key62->decode('Gh1a'); ```, (*10)

License

This project is released under the MIT License., (*11)

© 2017 Nik Gubin, All rights reserved., (*12)

The Versions

11/05 2017

dev-master

9999999-dev https://github.com/ngubin/key62

Generating a unique short key from the number.

  Sources   Download

MIT

The Requires

  • php >=5.4.45

 

11/05 2017

v1.0.1

1.0.1.0 https://github.com/ngubin/key62

Generating a unique short key from the number.

  Sources   Download

MIT

The Requires

  • php >=5.4.45

 

24/04 2017

v1.0.0

1.0.0.0 https://github.com/ngubin/key62

Generating a unique short key from the number.

  Sources   Download

MIT

The Requires

  • php >=5.4.45