承接 as3/short-mongo-id 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

as3/short-mongo-id

最新稳定版本:v1.0

Composer 安装命令:

composer require as3/short-mongo-id

包简介

Generates a short string identifier from a Mongo object id value.

README 文档

README

Generates a short string identifier from a MongoId value.

This repository is a PHP port of the npm/javascript library created by treygriffith. The usage and preamble of the following documentation is taken from that repository and modified for use with PHP. The original repo can be found here: https://github.com/treygriffith/short-mongo-id

========

Id's are generated from the timestamp and counter of the MongoDB Id, with some slight variation. They should be reasonably unique.

This is, unfortunately, a one-way function. It will reliably produce the same short id for the same MongoDB Id, but the operation can't be reversed (it is missing information about the machine id, process id, and most of the counter).

Install

Use Composer:

$ composer require as3/short-mongo-id

Usage

Pass a PHP MongoId object (or a string that can be converted to one) and it will return a reasonably unique short id made of [-_a-zA-Z0-9].

use As3\ShortMongoId\Shortener;

$shortener = new Shortener();
$shortId   = $shortener->shorten('507f191e810c19729de860ea'); // returns "iTxuMF"

License

MIT (see License)

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固