battleyephp/guid 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

battleyephp/guid

最新稳定版本:v2.0.0

Composer 安装命令:

composer require battleyephp/guid

包简介

PHP BattlEye GUID

README 文档

README

Latest Version on Packagist Tests Total Downloads

It provides BattlEye GUID value object.
It also can be converted from SteamID64.

Installation

Requires PHP 8.3+

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\Exceptions\InvalidGuidException;
use BattlEye\Guid\Guid;

try {
    Guid::fromString('invalid');
} catch (InvalidGuidException) {
    // ...
}

Shortcut method to check if GUIDs are the same:

use BattlEye\Guid\Guid;

$one = Guid::fromString('a0d1158281d8639495a1908b5a802470');
$two = Guid::fromSteamId64(76561198066209976);

if ($one->equals($two)) {
    // they are the same...
}

Testing

composer test

统计信息

  • 总下载量: 167
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固