generateReference

generateReference ( string _germ , int _size , int _base ) : string

Generate a fixed random reference from an input. If the input is the same, the reference is the same.

Parameters

_germ (optional)

ex: product id, url, etc. If nothing a random germ is generated.

_size (optional)

default:10

_base (optional)

default:36 (0-9,A-Z)
Define the number of possibilities for caraters. Examples :
• 36 = letters A-Z + numbers 0-9
• "letters" = letters A-Z
• "numeric" = numbers 0-9

Example


console(generateReference("ikutfg",15,16)) //-> 431C7AF889BAFC3 base-16
console(generateReference("ikutfg",15,2)) //-> 10111111000011 base-2
console(generateReference("ikutfg",10,16)) //-> AF889BAFC3