gmajor/sr25519-bindings 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

gmajor/sr25519-bindings

Composer 安装命令:

composer require gmajor/sr25519-bindings

包简介

sr25519 bindings

README 文档

README

PHP bindings for the GOLANG implementation of the sr25519 cryptography library

Reference to https://github.com/ChainSafe/go-schnorrkel

Installation

composer require gmajor/sr25519-bindings

Building

Requirement

  1. PHP 7 >= 7.4.0, PHP 8 FFI support
  2. GOLANG (>1.15)

Build

cd go && go build -buildmode=c-shared -o sr25519.so . && mv sr25519.so ../src/Crypto/sr25519.so

Basic Usage

Autoloading

Codec supports PSR-4 autoloaders.

<?php
# When installed via composer
require_once 'vendor/autoload.php';

KeyPair

Init a sr25519 KeyPair

<?php
use Crypto\sr25519;
$sr = new sr25519();
$secretSeed = "...";
$pair = $sr->InitKeyPair("{$secretSeed}");

sign message

You can sign a message by passing the message

<?php
use Crypto\sr25519;
$sr = new sr25519();
$sr->Sign($sr->InitKeyPair("secretSeed"), "msg");

verify signature

Verify a signature proof

<?php
use Crypto\sr25519;
$sr = new sr25519();
$sr->VerifySign($sr->InitKeyPair("secretSeed"), "helloworld", "signature");

XXHash 64 support

implementation of https://github.com/pierrec/xxHash/xxHash64

<?php
use Crypto\sr25519;
$sr = new sr25519();
$sr->XXHash64CheckSum(0, "helloworld");

Test

make test

Resources

License

The package is available as open source under the terms of the MIT License

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 3
  • 开发语言: Go

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固