PHPackages                             anerg2046/helper - 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. anerg2046/helper

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

anerg2046/helper
================

some helper libaray function

v1.0.12(7y ago)2314.0k↓75%20[1 PRs](https://github.com/anerg2046/helper/pulls)2MITPHPPHP &gt;=5.6.0

Since Jan 5Pushed 7y ago3 watchersCompare

[ Source](https://github.com/anerg2046/helper)[ Packagist](https://packagist.org/packages/anerg2046/helper)[ RSS](/packages/anerg2046-helper/feed)WikiDiscussions master Synced today

READMEChangelog (10)DependenciesVersions (13)Used By (2)

我自己常用的一些扩展类库
============

[](#我自己常用的一些扩展类库)

> 更新完善中 以下类库都在`\\anerg\\helper`命名空间下

Snowflake
---------

[](#snowflake)

> twitter的分布式全局唯一ID生成器PHP实现

```
//两个方法均可携带2个参数，第一个是机器编号，如果为0，则生成的id会忽略机器标识段
//第二个是数组，可用键值epoch，maxMachineBit，maxRandomBit
//具体请查询代码

// 获取一个10进制的唯一ID
Snowflake::nextId(1)

// 获取一个36进制的唯一ID
Snowflake::nextHash(1)

```

Http
----

[](#http)

> CURL相关操作

```
// 发起请求,get/post
Http::request($url, $data = null, $method = 'get', $params = null)

// get方式请求
Http::get($url, $data = null, $params = null)

// post方式请求
Http::post($url, $data = null, $params = null)

// post方式发送原始数据
Http::postRaw($url, $raw, $params = null)

// 带ssl证书请求原始数据
// $params数组必须包含cert_path,key_path,ca_path三个证书地址
Http::postRawSsl($url, $raw, $params)

//下载图片到指定位置
Http::saveImage($url, $path, $filename = null, $params = null)

```

Xml
---

[](#xml)

> XML与Array相关操作

```
// xml转为数组
Xml::xmlToArr($xml)

// 数组转为xml
Xml::arrToXml($array)

```

Encrypt
-------

[](#encrypt)

> 可逆加解密类,默认仅支持TP5,如果要支持其他,请修改getKey方法

```
// 加密字符串/数组
Encrypt::encrypt($data, $expire = 0, $key = '')

// 解密字符串
Encrypt::decrypt($data, $key = '')

```

Time
----

[](#time)

> 时间相关操作

```
// 输出优化后的时间显示格式
Time::pretty($time)

```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~64 days

Recently: every ~38 days

Total

12

Last Release

2753d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36bcee878f423e0e8e8c3bc57cd4198f3f255137b76b74446688b8e9df517336?d=identicon)[anerg2046](/maintainers/anerg2046)

---

Top Contributors

[![anerg2046](https://avatars.githubusercontent.com/u/3120629?v=4)](https://github.com/anerg2046 "anerg2046 (18 commits)")

### Embed Badge

![Health badge](/badges/anerg2046-helper/health.svg)

```
[![Health](https://phpackages.com/badges/anerg2046-helper/health.svg)](https://phpackages.com/packages/anerg2046-helper)
```

###  Alternatives

[stevebauman/wmi

A package for WMI manipulation using PHP and COM.

102.0k](/packages/stevebauman-wmi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
