Permalink
Browse files

some minor fixes

  • Loading branch information...
1 parent 24f8d86 commit 82cbebfe2ca2b01485f0da7607f7a3098d2119b8 @vanilla1280 vanilla1280 committed Mar 20, 2012
Showing with 4 additions and 0 deletions.
  1. +2 −0 Core/Utility/BaseConverter.php
  2. +2 −0 Core/Utility/Seeder.php
@@ -61,6 +61,7 @@ public static function newInstance()
public function setCharsetTo($charset)
{
$this->charsetTo = is_array($charset) ? $charset : str_split((string) $charset);
+
return $this;
}
@@ -73,6 +74,7 @@ public function setCharsetTo($charset)
public function setCharsetFrom($charset)
{
$this->charsetFrom = is_array($charset) ? $charset : str_split((string) $charset);
+
return $this;
}
View
@@ -113,6 +113,7 @@ public function buildRandomString($length = 12, $seed = '', $charset = '01234567
{
$return .= substr($string, 0, $length - strlen($return));
}
+
return $return;
}
@@ -122,6 +123,7 @@ public function buildRandomString($length = 12, $seed = '', $charset = '01234567
public function buildSeedString($algo = 'md5', $pad_length = 46, array $extra = array())
{
$hash = hash($algo, implode('', array_merge(array($this->getSessionSeed(), $this->getApplicationSeed()), $extra)));
+
return str_pad(implode('', array_map('hexdec', str_split($hash, 2))), (int) $pad_length, '0', STR_PAD_LEFT);
}
}

0 comments on commit 82cbebf

Please sign in to comment.