Skip to content

Instantly share code, notes, and snippets.

View BusinessDuck's full-sized avatar
🤘
pUNKs Not Dead

Dmitriy BusinessDuck

🤘
pUNKs Not Dead
View GitHub Profile
@BusinessDuck
BusinessDuck / test.php
Created December 29, 2024 19:23
Php example
<?php
namespace App;
use Web3\Web3;
use Web3\Providers\HttpProvider;
use Web3\RequestManagers\RequestManager;
use Web3\Contract;
use Web3\Utils;
use Web3\Validators\AddressValidator;
/* eslint-disable no-console */
const crypto = require('crypto');
/**
* Modulus operation with a twist. It takes two parameters, a and b, and returns the remainder
* of the division of a by b. However, there's a condition to handle the case when a is negative.
*/
function mod(a, b) {
return ((a % b) + b) % b;
}