Skip to content

Function corrected#1

Open
PatrickImProVision wants to merge 5 commits intoadmiyn:masterfrom
PatrickImProVision:patch-1
Open

Function corrected#1
PatrickImProVision wants to merge 5 commits intoadmiyn:masterfrom
PatrickImProVision:patch-1

Conversation

@PatrickImProVision
Copy link

Correction made in :
line 11 :
if($code_array[$i] == "Z")
changed to
if($code_array[$i] == end($chars))

line 23 :
if($code_array[$i -1] != 'Z')
changed to
if($code_array[$i -1] != end($chars))

line 32 :
$code_array[$j] = 0;
changed to
$code_array[$j] = reset($chars);

Because it detect last and first character/value in array
The generation was wrong.
For example when it should generate string BA, the function generated B0 instead.
Anyway the function is now working correctly.

Lukas Stribrny added 5 commits November 24, 2014 04:23
Correction made in :
line 11 :
if($code_array[$i] == "Z")
changed to
if($code_array[$i] == end($chars))

line 23 :
if($code_array[$i -1] != 'Z')
changed to
if($code_array[$i -1] != end($chars))

line 32 :
$code_array[$j] = 0;
changed to 
$code_array[$j] = reset($chars);

Because it detect last and first character/value in array
The generation was wrong.
For example when it should generate string BA, the function generated B0 instead.
Anyway the function is now working correctly.
I have put more option to choose from key types.
Sequential Alphanumeric Generator changed to Unique Sequential Alphanumeric Generator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant