https://github.com/digixglobal/hex_formatter
Convert IPFS addresses to hexadecimal and back
https://github.com/digixglobal/hex_formatter
Last synced: about 1 month ago
JSON representation
Convert IPFS addresses to hexadecimal and back
- Host: GitHub
- URL: https://github.com/digixglobal/hex_formatter
- Owner: DigixGlobal
- License: mit
- Created: 2018-03-13T10:20:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-30T03:20:05.000Z (about 7 years ago)
- Last Synced: 2025-06-19T12:46:28.654Z (12 months ago)
- Language: Ruby
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# HexFormatter
Convert IPFS addresses and Digix Asset addresses to hexadecimal and back
## Installation
```
gem install hex_formatter
```
## Gemfile
```
gem 'hex_formatter'
```
## Usage
```
require 'hex_formatter'
hf = HexFormatter::Ipfs.new
hf.encode('0x275406a99ea1b7ac819064670c34a2cbebab79c46c85b7c0e9f3feb4b6364dc5')
# => Qme79xMyGG3QTL2X9rvj5pqQu3KjTUJboN5xLDwTnoFv8C
hf = HexFormatter::Ipfs.new
hf.decode('Qme79xMyGG3QTL2X9rvj5pqQu3KjTUJboN5xLDwTnoFv8C')
# => "0x275406a99ea1b7ac819064670c34a2cbebab79c46c85b7c0e9f3feb4b6364dc5"
```