定制 rodrigoq/phpnetrandom 二次开发

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

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

rodrigoq/phpnetrandom

Composer 安装命令:

composer require rodrigoq/phpnetrandom

包简介

Port of .Net Random class to php

README 文档

README

A port of .Net Random class to php. Useful for migration purposes or comparison. Using the same seed, you get the same random values on .Net and php.

Installation

PhpNetRandom has no external dependencies. It can be included in a project directly adding this line to a php file:

<?php
include 'NetRandom.php';

It's also available on Packagist, and can be installed via Composer. Just add this line to your composer.json file:

"rodrigoq/phpnetrandom": "~1.0"

or run

composer require rodrigoq/phpnetrandom

Details

The NetRandom.php class is a direct port of the public code of original C# .Net Random class.

There are many tests that can be run with PHPUnit. There is also a C# .Net solution with a Random command line utility for testing purposes. To run the full test suite you have to compile that solution.

Usage

<?php

include 'NetRandom.php';

use NetRandom\NetRandom;

$random = new NetRandom(); //seed is optional.

// You can add max or, min and max parameters.
echo $random->Next() . PHP_EOL;

echo $random->NextDouble() . PHP_EOL;

$bytes = array_fill(0, 10, 0);
$random->NextBytes($bytes);
var_dump($bytes);

License

This software is distributed under the LGPL 3.0 license. Please read LICENSE for information on the software availability and distribution.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2019-10-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固