Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
SHAMAZING HASH ANALYSIS
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
test Add tests for repeating
.gitignore
Gemfile Use Rugged
README.md Update readme
Rakefile
shamazing.gemspec

README.md

shamazing

A library to discover amazing things about a SHA1 hash (or MD5 or whatever). It's sha-mazing. Almost as shamazing as that pun.

Areas of shamazingness

  • Longest string (9c2cddfaedaea9689a22e37aaa20191041554fe8)
  • Longest integer (9c2cddfaedaea9689a22e37aaa20191041554fe8)
  • Longest repeating sequence (9c2cddfaedaea9689a22e37aaa20191041554fe8)

Install

gem install shamazing

Usage

Command Line Interface

$ shamazing 9c2cddfaedaea9689a22e37aaa20191041554fe8
Longest string: cddfaedaea
Longest integer: 20191041554
Longest repeating: aaa

$ shamazing 9c2cddfaedaea9689a22e37aaa20191041554fe8 --string
cddfaedaea

$ shamazing 9c2cddfaedaea9689a22e37aaa20191041554fe8 -s
cddfaedaea

$ shamazing 9c2cddfaedaea9689a22e37aaa20191041554fe8 --integer
20191041554

$ shamazing 9c2cddfaedaea9689a22e37aaa20191041554fe8 -i
20191041554

$ shamazing 9c2cddfaedaea9689a22e37aaa20191041554fe8 --repeating
aaa

$ shamazing 9c2cddfaedaea9689a22e37aaa20191041554fe8 -r
aaa

# Search through the shas using `git log --format="%H"` in the current directory.
$ shamazing -s
cddfaedaea

# Return the full SHA with --full
$ shamazing --full
Longest string: 17705a5a37fbd11017f0d5e053b474dabbbd4022
Longest integer: 0c4b61fc2c5e7dd5566d42d0de1c431984899ddf
Longest repeating: 17705a5a37fbd11017f0d5e053b474dabbbd4022

Ruby Interface

require 'shamazing'

sha = '9c2cddfaedaea9689a22e37aaa20191041554fe8'

Shamazing.string(sha)
# => cddfaedaea

Shamazing.integer(sha)
# => 20191041554

Shamazing.repeating(sha)
# => aaa

shas = %w(
  fdb31214c2cca29e4f723ad676cddb043bd73986
  0c4b61fc2c5e7dd5566d42d0de1c431984899ddf
  9c2cddfaedaea9689a22e37aaa20191041554fe8
  f1b4c270f6746cbfff99bbf0f5a2388f4e509943
)
Shamazing.string_from_array(shas)
# => cddfaedaea
Shamazing.integer_from_array(shas)
# => 20191041554
Shamazing.repeating_from_array(shas)
# => fff

An Holman Project

Just a little diddy for dicking around with all these hashes. Made by @holman.

Something went wrong with that request. Please try again.