battleyephp/guid
最新稳定版本:v1.0.0
Composer 安装命令:
composer require battleyephp/guid
包简介
PHP BattlEye GUID
关键字:
README 文档
README
It provides BattlEye GUID value object.
It also can be converted from SteamID64.
Installation
Requires PHP 8.2+
You can install the package via composer:
composer require battleyephp/guid
Usage
To create a GUID from a SteamID64:
use BattlEye\Guid\Guid; $guid = Guid::fromSteamId64(76561198066209976); echo $guid->toString(); // 'a0d1158281d8639495a1908b5a802470' // It is stringable, so you can // cast it to the string. echo (string) $guid;
You can pass an already calculated GUID string to create an object:
use BattlEye\Guid\Guid; $guid = Guid::fromString('a0d1158281d8639495a1908b5a802470'); // same as $guid = new Guid('a0d1158281d8639495a1908b5a802470');
Note: It can contain only valid MD5 hash, otherwise it throws an exception.
use BattlEye\Guid\Guid; use InvalidArgumentException; try { Guid::fromString('invalid'); } catch (InvalidArgumentException) { // Invalid GUID }
Testing
composer test
统计信息
- 总下载量: 94
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-01