定制 semiorbit/guid 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

semiorbit/guid

最新稳定版本:v1.0.1

Composer 安装命令:

composer require semiorbit/guid

包简介

Generate a GUID in PHP that is compatible with Microsoft .NET Framework (C#) GUID.

README 文档

README

Semiorbit GUID is a PHP library to create a GUID that is compatible with Microsoft .NET Framework (C#) GUID.

Install

composer require semiorbit/guid

Documentation

Guid::NewGuid

Generates a GUID that is compatible with Microsoft .NET Framework GUID.

Guid::NewGuid(string $separator = '-', bool $enclose = true) : string

Params

  • string $separator dash by default
  • bool $enclose enclose a GUID in curly braces.
  • returns string
use SemiorbitGuid\Guid;

echo Guid::NewGuid();

// OUTPUT:
// {6BE33503-D448-0264-11AC-38822224B694}

Guid::Create

Generates a raw GUID that is compatible with Microsoft .NET Framework GUID, but not formatted or enclosed.

Guid::Create(): string
  • returns string
use SemiorbitGuid\Guid;

echo Guid::Create();

// OUTPUT:
// 53FED73BF73C7D4C720DD8EE8DAB8B2B

Guid::Format

Returns a formatted GUID string width dashes (or selected separator) and optionally enclosed with curly braces

Guid::Format(string $guid, bool $enclose = true, string $separator = '-'): string

Params

  • string $guid A guid string to parse
  • bool $enclose True by default, to enclose guid string by {curly braces}
  • string $separator Dash by default
  • returns string {xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx}
use SemiorbitGuid\Guid;

$guid = '4F93820EFEF290A26489E0AE803A37C0';

echo Guid::Format($guid);

// OUTPUT:
// {4F93820E-FEF2-90A2-6489-E0AE803A37C0}

License

The Semiorbit GUID is an open-source PHP library licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-22