Port of PHP Rediska Key Distributor to Javascript