当前位置: 首页>>代码示例>>PHP>>正文


PHP RandomGenerator::generateEntropy方法代码示例

本文整理汇总了PHP中RandomGenerator::generateEntropy方法的典型用法代码示例。如果您正苦于以下问题:PHP RandomGenerator::generateEntropy方法的具体用法?PHP RandomGenerator::generateEntropy怎么用?PHP RandomGenerator::generateEntropy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RandomGenerator的用法示例。


在下文中一共展示了RandomGenerator::generateEntropy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGenerateEntropy

	function testGenerateEntropy() {
		$r = new RandomGenerator();
		$this->assertNotNull($r->generateEntropy());
		$this->assertNotEquals($r->generateEntropy(), $r->generateEntropy());
	}
开发者ID:redema,项目名称:sapphire,代码行数:5,代码来源:RandomGeneratorTest.php

示例2: generateFilename

 /**
  * Returns a unique filename, including project/environment/timestamp details.
  * @return string
  */
 public function generateFilename(DNDataTransfer $dataTransfer)
 {
     $generator = new RandomGenerator();
     $filter = FileNameFilter::create();
     return sprintf('%s-%s-%s-%s-%s', $filter->filter(strtolower($this->OriginalEnvironment()->Project()->Name)), $filter->filter(strtolower($this->OriginalEnvironment()->Name)), $dataTransfer->Mode, date('Ymd'), sha1($generator->generateEntropy()));
 }
开发者ID:antons-,项目名称:deploynaut,代码行数:10,代码来源:DNDataArchive.php

示例3: generateFilename

 /**
  * Returns a unique filename, including project/environment/timestamp details.
  * @return string
  */
 public function generateFilename(DNDataTransfer $dataTransfer)
 {
     $generator = new RandomGenerator();
     $sanitizeRegex = array('/\\s+/', '/[^a-zA-Z0-9-_\\.]/');
     $sanitizeReplace = array('/_/', '');
     $envName = strtolower(preg_replace($sanitizeRegex, $sanitizeReplace, $this->OriginalEnvironment()->Name));
     $projectName = strtolower(preg_replace($sanitizeRegex, $sanitizeReplace, $this->OriginalEnvironment()->Project()->Name));
     return sprintf('%s-%s-%s-%s-%s', $projectName, $envName, $dataTransfer->Mode, date('Ymd'), sha1($generator->generateEntropy()));
 }
开发者ID:ss23,项目名称:deploynaut,代码行数:13,代码来源:DNDataArchive.php


注:本文中的RandomGenerator::generateEntropy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。