private function newKey($hash, $length, $key = '')
  {
    $generated = $this->hasReq(Hash::secure($length));

    if ($hash == 'base64') {
      $key = 'base64:' . base64_encode($generated);
    } else {
      $key = $hash . ':' . $generated;
    }

    return $key;
  }
private function newKey($hash, $length, $key = '')
  {
    $generated = $this->hasReq(Hash::secure($length));

    if ($hash == 'base64') {
      $key = 'base64:' . base64_encode($generated);
    } else {
      $key = $hash . ':' . $generated;
    }

    return $key;
  }
private function newKey ( $ hash , $ length , $ key = '' ) { $ generated = $ this -> hasReq ( Hash :: secure ( $ length ) ) ; if ( $ hash == 'base64' ) { $ key = 'base64:' . base64_encode ( $ generated ) ; } else { $ key = $ hash . ':' . $ generated ; } return $ key ; }
Generate a new key

@param string $hash
@param int $length
@param string $key
@return string
Generate a new key