[TYPO3-core] RFC #8514: Feature: Add StdWrap feature "random Number/String"

JoH asenau info at cybercraft.de
Tue Sep 14 13:28:23 CEST 2010


> Some background on "random numbers":
> 
> Java's Math.random(): float between 0 and 1
> C++ rand(): integer between 0 and RAND_MAX (>= 32767)
> Python's random.random(): float between 0 and 1
> PHP's rand(): integer between 0 and (>=32768)
> 
> -> default minimum = 0
>
> Key "number" is not descriptive! I'd favour keys integer & float.

+1, since there might be use cases for both, although most of the cases would need an integer

> Besides, t3lib_div::generateRandomBytes does not generate a string
> usable for a "random password". It generates "byte"-sequences!
> 
> Generating a "random password" is a complex use case (character pools,
> umlauts, character encodings). I'd focus on basics at first:
> Integers, floats, hexstrings (see also
> t3lib_div::getRandomHexString()). 

+1
 
> To comment Benjamin's comment in the bugtracker:
> Having
> stdWrap.hash = md5
> is useless because you are not interested in a transformation (hashing
> of an input) but only on the representation = a hex string
> Thats why I mentioned hexstring instead of a hash key.

+1 as well

BTW: Did you mean it as a general +1 for the having random values available via stdWrap as long as the patch gets the changes you mentioned?

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com


More information about the TYPO3-team-core mailing list