public function setSecret($secret, $format = self::FORMAT_RAW)
    {
        if ($format == static::FORMAT_HEX) {
            $secret = hex2bin($secret);
        } elseif ($format == static::FORMAT_BASE32) {
            $secret = $this->base32decode($secret);
        }

        $this->secret = $secret;
    }