Nuclear Powered Macros

    solidity-string-util

    0.1.0 • Public • Published

    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 name Description
    toHash Returns the keccak256 hash of a string
    isEmpty Returns 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.

    Install

    npm i solidity-string-util

    DownloadsWeekly Downloads

    52

    Version

    0.1.0

    License

    Apache-2.0

    Unpacked Size

    18.6 kB

    Total Files

    15

    Last publish

    Collaborators

    • iobuilders