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


PHP Hash类代码示例

本文整理汇总了PHP中Hash的典型用法代码示例。如果您正苦于以下问题:PHP Hash类的具体用法?PHP Hash怎么用?PHP Hash使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createParent

 public function createParent()
 {
     $input = Input::all();
     if (Input::hasFile('profilepic')) {
         $input['profilepic'] = $this->filestore(Input::file('profilepic'));
     }
     $input['dob'] = date('Y-m-d H:i:s', strtotime(Input::get('dob')));
     $input['collegeid'] = Session::get('user')->collegeid;
     $input['collegename'] = Admin::where('collegeid', '=', Session::get('user')->collegeid)->first()->collegename;
     //$input['collegeid']="dummy";
     //$input['collegename']="dummy";
     $user = new User();
     $user->email = $input['email'];
     $user->password = Hash::make($input['password']);
     $user->collegeid = $input['collegeid'];
     $user->flag = 3;
     $user->save();
     $input['loginid'] = $user->id;
     $removed = array('_token', 'password', 'cpassword');
     foreach ($removed as $k) {
         unset($input[$k]);
     }
     Parent::saveFormData($input);
     return $input;
 }
开发者ID:pankaja455,项目名称:WebSchool,代码行数:25,代码来源:ParentController.php

示例2: setLabel

 /**
  * Add a label
  *
  * @return void
  * @author Justin Palmer
  **/
 public static function setLabel($key, $value)
 {
     if (!self::$Labels instanceof Hash) {
         self::$Labels = new Hash();
     }
     self::$Labels->set($key, $value);
 }
开发者ID:ToddBudde,项目名称:phrails,代码行数:13,代码来源:FlashForm.php

示例3: testFilter

 public function testFilter()
 {
     $filter = new Hash();
     $this->assertEquals('0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33', $filter->apply('foo'));
     $filter = new Hash('sha256');
     $this->assertEquals('2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae', $filter->apply('foo'));
 }
开发者ID:seytar,项目名称:psx,代码行数:7,代码来源:HashTest.php

示例4: decodeHash

 public function decodeHash()
 {
     $h = new Hash();
     $this->nextToken();
     $this->skipBlanks();
     if ($this->c === 125) {
         $this->nextToken();
         return $h;
     }
     while ($this->c !== 125) {
         $key = $this->decodeString();
         $this->skipBlanks();
         if ($this->c !== 58) {
             throw new HException("Expected ':'.");
         }
         $this->nextToken();
         $this->skipBlanks();
         $o = $this->localDecode();
         $h->set($key, $o);
         $this->skipBlanks();
         if ($this->c === 44) {
             $this->nextToken();
             $this->skipBlanks();
         } else {
             if ($this->c !== 125) {
                 throw new HException("Expected ',' or '}'. " . $this->getPositionRepresentation());
             }
         }
         unset($o, $key);
     }
     $this->nextToken();
     return $h;
 }
开发者ID:komcdo,项目名称:winnow,代码行数:33,代码来源:JSon.class.php

示例5: generatePassword

 /**
  * Hashes a password.
  * 
  * @param String $password
  * @return Array
  * [
  *   password => <string>
  *   salt => <string>
  * ]
  */
 public function generatePassword($password)
 {
     $hashGenerator = new Hash();
     $salt = $hashGenerator->generateSalt(32);
     $hashedPassword = $this->generatePasswordWithSalt($password, $salt);
     return ['password' => $hashedPassword, 'salt' => $salt];
 }
开发者ID:Liviath,项目名称:saveCodeManager,代码行数:17,代码来源:Password.php

示例6: hash

 /**
  * @param $string
  *
  * @return Hash
  */
 public function hash(string $string) : Hash
 {
     $hash = new Hash();
     $hash->setAlgorithm($this->getAlgorithm());
     $value = hash_hmac($this->getAlgorithm(), $string, $this->getSecret(), true);
     $hash->setValue($value);
     return $hash;
 }
开发者ID:blar,项目名称:hash,代码行数:13,代码来源:HmacHashGenerator.php

示例7: getAuthorizationHeader

 function getAuthorizationHeader($verb, $url)
 {
     // UrlPath = <HTTP-Request-URI, from the port to the query string>
     $str = join("\n", array($verb, $date, $url));
     $h = new Hash('sha1');
     $sig = base64($h->hmac(str, $privkey));
     $header = 'BNET ' . $pubkey . ':' . $sig;
 }
开发者ID:noccy80,项目名称:lepton-ng,代码行数:8,代码来源:wow.php

示例8: hashOfAssociativeArray

 static function hashOfAssociativeArray($arr)
 {
     $h = new Hash();
     reset($arr);
     while (list($k, $v) = each($arr)) {
         $h->set($k, $v);
     }
     return $h;
 }
开发者ID:ralcr,项目名称:Apple-s-Dictionary-App-database-generator,代码行数:9,代码来源:Lib.class.php

示例9: hasherize

 public function hasherize($key)
 {
     $value = $this->offsetGet($key);
     if (is_array($value)) {
         $hash = new Hash();
         return $hash->merge($value);
     }
     return $value;
 }
开发者ID:amptools-net,项目名称:midori-php,代码行数:9,代码来源:Hash.php

示例10: fromProperties

 static function fromProperties($prop)
 {
     $ht = new Hash();
     $key = "";
     $value = "";
     foreach ($prop as $key => $value) {
         $ht->set($key, $value);
     }
     return $ht;
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:10,代码来源:PropertiesTools.class.php

示例11: computeInverse

 static function computeInverse($dict)
 {
     $keys = $dict->keys();
     $outDict = new Hash();
     while ($keys->hasNext()) {
         $key = $keys->next();
         $outDict->set($dict->get($key), $key);
         unset($key);
     }
     return $outDict;
 }
开发者ID:komcdo,项目名称:winnow,代码行数:11,代码来源:ConfigurationKeys.class.php

示例12: render

function render($template, $locals = array())
{
    $context = new Hash(array('response' => response(), 'request' => request(), 'route' => route()));
    $context->params = $context->request->params;
    $context->merge($locals);
    $views = options()->get('views', __DIR__ . '/views');
    $filename = realpath("{$views}/{$template}");
    ob_start();
    $included = php($filename, $context);
    $output = ob_get_clean();
    return $included ? $output : false;
}
开发者ID:noonat,项目名称:pipes,代码行数:12,代码来源:helpers.php

示例13: CreateChildren

 private function CreateChildren(array $array)
 {
     foreach ($array as $key => $value) {
         if (is_array($value)) {
             $tmp = new Hash();
             $tmp->Load($value);
             $this->offsetSet($key, $tmp);
         } else {
             $this->offsetSet($key, $value);
         }
     }
     return true;
 }
开发者ID:BookOfOrigin,项目名称:Ori,代码行数:13,代码来源:Hash.php

示例14: getRolesRoomsUsers

 /**
  * Return roles_rooms_users
  *
  * @param array $conditions Conditions by Model::find
  * @return array
  */
 public function getRolesRoomsUsers($conditions = array())
 {
     $this->Room = ClassRegistry::init('Rooms.Room');
     $conditions = Hash::merge(array('Room.page_id_top NOT' => null), $conditions);
     $rolesRoomsUsers = $this->find('all', array('recursive' => -1, 'fields' => array($this->alias . '.*', $this->RolesRoom->alias . '.*', $this->Room->alias . '.*'), 'joins' => array(array('table' => $this->RolesRoom->table, 'alias' => $this->RolesRoom->alias, 'type' => 'INNER', 'conditions' => array($this->alias . '.roles_room_id' . ' = ' . $this->RolesRoom->alias . ' .id')), array('table' => $this->Room->table, 'alias' => $this->Room->alias, 'type' => 'INNER', 'conditions' => array($this->RolesRoom->alias . '.room_id' . ' = ' . $this->Room->alias . ' .id'))), 'conditions' => $conditions));
     return $rolesRoomsUsers;
 }
开发者ID:Onasusweb,项目名称:Rooms,代码行数:13,代码来源:RolesRoomsUser.php

示例15: edit

 /**
  * edit
  *
  * @return void
  */
 public function edit()
 {
     //事前準備
     $this->__prepare();
     //リクエストセット
     if ($this->request->is('post')) {
         $this->set('membershipTab', Hash::get($this->request->data['SiteSetting'], 'membershipTab', 'automatic-registration'));
         $this->request->data['SiteSetting'] = Hash::remove($this->request->data['SiteSetting'], 'membershipTab');
         $automaticInputItems = Hash::get($this->request->data, '_siteManager.automaticInputItems', 'false');
         $this->Session->write('automaticInputItems', $automaticInputItems);
         $this->__parseRequestData();
         $this->SiteSetting->autoRegistRoles = $this->viewVars['userRoles'];
         //登録処理
         $redirect = Router::parse($this->referer());
         $redirect['?'] = array('membershipTab' => $this->viewVars['membershipTab']);
         $this->SiteManager->saveData($redirect);
     } else {
         $this->set('membershipTab', Hash::get($this->request->query, 'membershipTab', 'automatic-registration'));
         if ($this->Session->read('automaticInputItems')) {
             $automaticInputItems = $this->Session->read('automaticInputItems');
             $this->Session->delete('automaticInputItems');
         } else {
             $automaticInputItems = 'false';
         }
         $this->request->data['SiteSetting'] = $this->SiteSetting->getSiteSettingForEdit(array('SiteSetting.key' => array('AutoRegist.use_automatic_register', 'AutoRegist.confirmation', 'AutoRegist.use_secret_key', 'AutoRegist.secret_key', 'AutoRegist.role_key', 'AutoRegist.prarticipate_default_room', 'AutoRegist.disclaimer', 'AutoRegist.approval_mail_subject', 'AutoRegist.approval_mail_body', 'AutoRegist.acceptance_mail_subject', 'AutoRegist.acceptance_mail_body', 'UserRegist.mail_subject', 'UserRegist.mail_body', 'UserCancel.use_cancel_feature', 'UserCancel.disclaimer', 'UserCancel.notify_administrators', 'UserCancel.mail_subject', 'UserCancel.mail_body')));
     }
     $this->set('automaticInputItems', $automaticInputItems);
 }
开发者ID:NetCommons3,项目名称:SiteManager,代码行数:33,代码来源:MembershipController.php


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