RehabMan
Moderator
- Joined
- May 2, 2012
- Messages
- 181,016
- Motherboard
- Intel DH67BL
- CPU
- i7-2600K
- Graphics
- HD 3000
- Mac
- Mobile Phone
HP ProBook Installer 6.1 (beta): Ivy bridge support
There's a bug in the new random serial# generator. Problem is in the part which generates the 3-random number sequence.
I reproduced the problem in Terminal (bash):
Output(when second line is run many times):
First of all you'll notice there will only end up 34 valid combinations generated, because each character ends up consecutive. Two of the possible values generated are not valid ('90' and '0') because they are not 3 characters.
The expression should probably use:
As that will generate three random characters from the list of valid chars instead of a random substring of the valid chars...
Example:
- This is my favourite! A new serial number generator is added to all System definition options, so you'll get an unique Mac serial number on every ProBook run. Every time when you want to change your Mac serial number, just run the Installer and select only your system definition.
There's a bug in the new random serial# generator. Problem is in the part which generates the 3-random number sequence.
I reproduced the problem in Terminal (bash):
Code:
chars=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
echo ${chars:$(($RANDOM%${#chars})):3}
Output(when second line is run many times):
Code:
Speedy-ML:~ Admin$ for i in {1..20}; do echo ${chars:$(($RANDOM%${#chars})):3}; done
567
BCD
OPQ
STU
456
QRS
KLM
HIJ
789
VWX
OPQ
0
789
234
90
LMN
IJK
678
OPQ
0
First of all you'll notice there will only end up 34 valid combinations generated, because each character ends up consecutive. Two of the possible values generated are not valid ('90' and '0') because they are not 3 characters.
The expression should probably use:
Code:
${chars:$(($RANDOM%${#chars})):1}${chars:$(($RANDOM%${#chars})):1}${chars:$(($RANDOM%${#chars})):1}
As that will generate three random characters from the list of valid chars instead of a random substring of the valid chars...
Example:
Code:
Speedy-ML:~ Admin$ for i in {1..20}; do echo ${chars:$(($RANDOM%${#chars})):1}${chars:$(($RANDOM%${#chars})):1}${chars:$(($RANDOM%${#chars})):1}; done
XAR
WDO
T80
BKN
629
5PY
I6K
GD6
VJS
FF3
JGE
KWX
YRK
MWI
7UG
KBK
SKS
U79
T2A
2D4