25 if (!is_int($length) || $length > 32 || $length < 1) {
26 throw new \InvalidArgumentException(
'The uid length must be an integer between 1 and 32');
29 $this->uid = substr(
hash(
'md5', uniqid(
'',
true)), 0, $length);
An exception for terminatinating execution or to throw for unit testing.
Adds a unique identifier into records.
hash(StreamInterface $stream, $algo, $rawOutput=false)
Calculate a hash of a Stream.