diff options
Diffstat (limited to 'lib/private/Files/ObjectStore')
-rw-r--r-- | lib/private/Files/ObjectStore/Mapper.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/Files/ObjectStore/Mapper.php b/lib/private/Files/ObjectStore/Mapper.php index bfb4e998150..81f8a9e3fa5 100644 --- a/lib/private/Files/ObjectStore/Mapper.php +++ b/lib/private/Files/ObjectStore/Mapper.php @@ -44,10 +44,12 @@ class Mapper { } /** + * @param int $numBuckets * @return string */ - public function getBucket() { + public function getBucket($numBuckets = 64) { $hash = md5($this->user->getUID()); - return substr($hash, 0, 3); + $num = hexdec(substr($hash, 0, 4)); + return (string)($num % $numBuckets); } -}
\ No newline at end of file +} |