承接 nrk/bencoder 相关项目开发

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

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

nrk/bencoder

Composer 安装命令:

composer require nrk/bencoder

包简介

A Bencode serializer and deserializer in pure PHP

README 文档

README

About

Bencoder is an utility class implemented in pure PHP that handles the serialization and deserialization of objects using the Bencode encoding format.

The original implementation of this class dates back to the early months of 2004 and it has been somewhat adapted and updated in order to work with modern versions of the PHP interpreter right before making it public. Basically I am making this library open source just because someone might find it useful and it would be a shame to let it rot in the meanders of my backups.

Implementation details

  • As per specifications, this class does not handle float / double values.
  • The serialization and deserialization of integers greater than 2147483647 works only when using a 64bit PHP interpreter.
  • PHP arrays containing one or more string values as keys are interpreted as Bencode dictionaries.
  • The serializer does not check for circular references and it breaks generating a stack overflow error.

Example

<?php
require 'autoloader.php';

use Bencoder\Bencode;

$structure = array("oh", "rly?", "ya", "rly!");
$encoded = Bencode::encode($structure);
$decoded = Bencode::decode($encoded);

Author

License

The code for Bencoder is distributed under the terms of the MIT license (see LICENSE).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2011-12-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固