https://github.com/andrew/ruby-multihash
A simple multihash (https://github.com/multiformats/multihash) implementation for ruby.
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 5 committers (20.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.4%) to scientific vocabulary
Last synced: 9 months ago
·
JSON representation
Repository
A simple multihash (https://github.com/multiformats/multihash) implementation for ruby.
Statistics
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 0
Fork of multiformats/ruby-multihash
Created over 5 years ago
· Last pushed over 6 years ago
https://github.com/andrew/ruby-multihash/blob/master/
# ruby-multihash
[](https://github.com/multiformats/multiformats)
[](https://webchat.freenode.net/?channels=%23ipfs)
[](https://github.com/RichardLitt/standard-readme)
[](https://travis-ci.org/multiformats/ruby-multihash)
[](https://codecov.io/github/multiformats/ruby-multihash?branch=master)
> A simple [Multihash](https://github.com/multiformats/multihash) implementation for ruby.
A multihash is a digest with an embedded hash function code (and length) (['cause you never know](https://twitter.com/matthew_d_green/status/597409850381836288)). It was developed primarily for use with [IPFS](https://github.com/ipfs/ipfs), but is not specific to it.
## Install
Add this line to your application's Gemfile:
```ruby
gem 'multihashes'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install multihashes
## Usage
This is a low-level library. Bring your own digest. A binary digest goes in, a binary digest goes out. To compute a sha256 multihash that would work nicely with [IPFS](https://github.com/ipfs/ipfs):
```ruby
require 'multihashes'
require 'digest'
digest = Digest::SHA256.digest 'Dade Murphy will never figure this one out'
multihash_binary_string = Multihashes.encode digest, 'sha2-256'
multihash_binary_string.unpack('H*').first # hex: "1220142711d38ca7a33c521841..."
out = Multihashes.decode multihash_binary_string
# => {:code=>18, :hash_function=>"sha2-256", :length=>32, :digest=>"\x14'\x11\xD3\x8C\xA7\xA3
Owner
- Name: Andrew Nesbitt
- Login: andrew
- Kind: user
- Location: Bristol, UK
- Company: @ecosyste-ms and @octobox
- Website: https://nesbitt.io
- Twitter: teabass
- Repositories: 357
- Profile: https://github.com/andrew
Working on mapping the world of open source software @ecosyste-ms and empowering developers with @octobox
GitHub Events
Total
Last Year
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Kyle Drake | k****e@k****t | 7 |
| Derk-Jan Karrenbeld | d****b@k****o | 2 |
| Richard Littauer | r****r@g****m | 2 |
| Stephen Paul Weber | s****a@s****t | 1 |
| bmquinn | b****n@n****u | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0