PHPackages                             pangongzi/algorithm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pangongzi/algorithm

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pangongzi/algorithm
===================

A PHP library for implementing various algorithms

v2025.02.19(1y ago)013MITPHPPHP &gt;=7.3

Since Feb 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pangongzi/algorithm)[ Packagist](https://packagist.org/packages/pangongzi/algorithm)[ Docs](https://github.com/pangongzi/algorithm)[ RSS](/packages/pangongzi-algorithm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Algorithm | php算法库
==================

[](#algorithm--php算法库)

### 项目描述

[](#项目描述)

`pangongzi/algorithm` 是一个 PHP 库，提供了多种算法的实现，包括雪花算法等。
目前仅有雪花算法

### 安装

[](#安装)

使用 Composer 安装：

```
# 安装
composer require pangongzi/algorithm

# 更新
composer update pangongzi/algorithm

# 删除
composer remove pangongzi/algorithm
```

### 使用方法

[](#使用方法)

雪花算法 初始化 首先，需要引入自动加载文件并实例化 SnowflakeService 类：

```
