Skip to content

webtoolkit/invitious

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Invitious: Invitation Code Generator

This library creates invitation codes like Ello.co does. Something like at-tight-level-96e or swim-continent-main-d9e.

API

<?php
Invitious::generate(
  $type = self::ENGLISH_WORD_GENERATOR,
  $count = 3,
  $delimiter = '-',
  $salt = null,
  $saltLength = 3
)

Whereas:

  • $type is the type of words, which can be:
  • Invitious::ENGLISH_WORD_GENERATOR (default)
  • Invitious::BOY_NAME_GENERATOR
  • Invitious::GIRL_NAME_GENERATOR
  • $count is the amount of words that are to be generated.
  • $delimiter is the string that separates the words.
  • $salt is a string which will be used to salt the unique key.
  • $saltLenght the amount of characters of the unique key that should be added.

Example

<?php
use Invitious\Invitious;

// Basic code
echo Invitious::generate(Invitious::ENGLISH_WORD_GENERATOR);

// Custom length
echo Invitious::generate(Invitious::ENGLISH_WORD_GENERATOR, 4);

// Custom separator
echo Invitious::generate(Invitious::ENGLISH_WORD_GENERATOR, 4, '_');

// With a key
echo Invitious::generate(Invitious::ENGLISH_WORD_GENERATOR, 4, '_', 'hello');

// With a custom key length
echo Invitious::generate(Invitious::ENGLISH_WORD_GENERATOR, 4, '_', 'hello', 10);

About

Invitation code generator like the one used on Ello.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages