New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

solidity-string-util

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

solidity-string-util

A simply Solidity library for common string operations

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
30
130.77%
Maintainers
1
Weekly downloads
 
Created
Source

solidity-string-util

Build Status Coverage Status npm

A simply Solidity library for common string operations.

Install

npm install solidity-string-util

Usage

To write your custom contracts, import it and attach it to the string type:

pragma solidity ^0.5.0;

import 'solidity-string-util/contracts/StringUtil.sol';

contract YourContract {
    using StringUtil for string;

    // your custom code
}

You need an ethereum development framework for the above import statements to work! Check out these guides for Truffle, Embark or Buidler.

Please see the Solidity documentation on libraries for more details on how to work with libraries.

Available functions

Function nameDescription
toHashReturns the keccak256 hash of a string
isEmptyReturns true if a string is empty, false otherwise

Tests

To run the unit tests execute npm test.

Code coverage

To run the code coverage simply execute npm run coverage.

Keywords

solidity

FAQs

Package last updated on 22 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts