• <b id="l3qpx"><abbr id="l3qpx"></abbr></b>
  • <th id="l3qpx"><progress id="l3qpx"></progress></th>
      <th id="l3qpx"></th>
      <dd id="l3qpx"><font id="l3qpx"></font></dd>
      <th id="l3qpx"></th>
      0712-2888027 189-8648-0214
      微信公眾號

      孝感風信網(wǎng)絡科技有限公司微信公眾號

      當前位置:主頁 > 技術支持 > PHP > Laravel Hashids一款不錯的哈希數(shù)據(jù)ID解決方案

      Laravel Hashids一款不錯的哈希數(shù)據(jù)ID解決方案

      時間:2018-12-04來源:風信官網(wǎng) 點擊: 1809次
      在Laravel中我們使用composer進行安裝 vinkla/hashids開源庫,可以將字符串ID轉化為數(shù)字ID。

      我們使用composer進行安裝,最新的laravel-hashids 需要Laravel 5.6版本以上支持。

      $ composer require vinkla/hashids

      擴展包配置

      $ php artisan vendor:publish

      GitHUB項目地址:https://github.com/vinkla/laravel-hashids

      使用示例代碼:

      使用use引入Hashids

      // You can alias this in config/app.php.
      use Vinkla\Hashids\Facades\Hashids;

      對字符串進行加密
      Hashids::encode(4815162342);
      // We're done here - how easy was that, it just works!

      對字符串進行解密
      Hashids::decode('doyouthinkthatsairyourebreathingnow');
      // This example is simple and there are far more methods available.
      欄目列表
      推薦內容
      熱點內容
      展開
      欧美一区二区三区免费A级视频,亚洲精品中文字幕综合,动漫精品中文字幕无码第一页,1024亚洲国产综合 亚太影院 柯西贝尔-游戏赚网
    1. <b id="l3qpx"><abbr id="l3qpx"></abbr></b>
    2. <th id="l3qpx"><progress id="l3qpx"></progress></th>
        <th id="l3qpx"></th>
        <dd id="l3qpx"><font id="l3qpx"></font></dd>
        <th id="l3qpx"></th>