<?php
namespace Root\Core\Cipher;

class RunicKey
{
    public static function generate(string $seed, int $len = 32): string
    {
        $h = sha1($seed . php_uname());
        $out = '';
        for ($i = 0; $i < $len; $i++) {
            $c = ord($h[$i % strlen($h)]) ^ ($i * 13 % 255);
            $out .= chr(($c << 1) | ($c >> 7));
        }
        return bin2hex($out);
    }
}
