Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pipermerriam/ethereum-string-utils
String utility functions for ethereum contracts
https://github.com/pipermerriam/ethereum-string-utils
Last synced: about 2 months ago
JSON representation
String utility functions for ethereum contracts
- Host: GitHub
- URL: https://github.com/pipermerriam/ethereum-string-utils
- Owner: pipermerriam
- License: mit
- Created: 2015-10-12T17:34:12.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-13T02:50:38.000Z (about 9 years ago)
- Last Synced: 2024-10-09T16:02:11.333Z (2 months ago)
- Language: Python
- Size: 101 KB
- Stars: 40
- Watchers: 9
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-smart-contracts - pipermerriam/ethereum-string-utils - String utility functions for ethereum contracts. (Libraries)
- awesome-smart-contracts - pipermerriam/ethereum-string-utils - String utility functions for ethereum contracts. (Libraries)
README
# Ethereum String Utils
String Utility library for ethereum contracts.
Usable as a library or to make direct calls against via `0xcca8353a18e7ab7b3d094ee1f9ddc91bdf2ca6a4`
Compiled on OSX using solc version `0.1.5-23865e39` with the `--optimize` flag enabled.
## API
* `function uintToBytes(uint v) constant returns (bytes32 ret)`
Converts an unsigned integer to it's string representation.
```javascript
> stringUtils.uintToBytes(1234)
"1234"
```* `function bytesToUInt(uint v) constant returns (uint ret)`
Converts a numeric string to it's unsigned integer representation.
```javascript
> stringUtils.bytesToUInt("1234")
1234
```