PHP code example of cexll / hash-encode

1. Go to this page and download the library: Download cexll/hash-encode library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cexll / hash-encode example snippets


function hash($data): array
{
    # 设置rsa 公钥 密钥
    hashEncode::setPrivateKeyPath('path');
    #hashEncode::setPublicKeyPath('path'); 这里可以不用公钥地址, 因为只加密不解密 
    
    # 加密
    return hashEncode::hash_encode(json_encode($data, JSON_UNESCAPED_UNICODE));
}