easyhash

The easiest way to generate HEX hashs in Groovy and Java

License

License

GroupId

GroupId

com.lazythought
ArtifactId

ArtifactId

easyhash
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

easyhash
The easiest way to generate HEX hashs in Groovy and Java
Source Code Management

Source Code Management

http://github.com/poiati/easyhash

Download easyhash

How to add to project

<!-- https://jarcasting.com/artifacts/com.lazythought/easyhash/ -->
<dependency>
    <groupId>com.lazythought</groupId>
    <artifactId>easyhash</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.lazythought/easyhash/
implementation 'com.lazythought:easyhash:1.0'
// https://jarcasting.com/artifacts/com.lazythought/easyhash/
implementation ("com.lazythought:easyhash:1.0")
'com.lazythought:easyhash:jar:1.0'
<dependency org="com.lazythought" name="easyhash" rev="1.0">
  <artifact name="easyhash" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.lazythought', module='easyhash', version='1.0')
)
libraryDependencies += "com.lazythought" % "easyhash" % "1.0"
[com.lazythought/easyhash "1.0"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.10

Project Modules

There are no modules declared in this project.

Easyhash

The easyhash is an utility to easily generate cryptographic hashes in it's hexadecimal form.

Currently two cryptographic hash function are supported:

  • MD5
  • SHA-1

Usage

You can use easyhash in Java or Groovy programs.

Java

First, Put the easyhash jar into the classpath and then:

import static com.lazythought.easyhash.HashGenerator.*;
...
assert "ab07acbb1e496801937adfa772424bf7".equals(HashGenerator.md5("foo bar baz"));
assert "c7567e8b39e2428e38bf9c9226ac68de4c67dc39".equals(HashGenerator.sha1("foo bar baz"));
...

Groovy

With Groovy you can use the @Grab AST:

@Grab('com.lazythought:easyhash:1.0')
import static com.lazythought.easyhash.HashGenerator.*

assert 'ab07acbb1e496801937adfa772424bf7' == md5('foo bar baz')
assert 'c7567e8b39e2428e38bf9c9226ac68de4c67dc39' == sha1('foo bar baz')

There is also the HashCategory option:

@Grab('com.lazythought:easyhash:1.0')
import com.lazythought.easyhash.HashCategory

use(HashCategory) {
    assert 'b071ed8a2de56ecd5958305641a81755' == 'frodo bags'.md5()
    assert 'b6b5ece040fd0c467cb189a284c6e7c752c747f5' == 'frodo bags'.sha1()
}

Build

Build with Gradle ( http://gradle.org/ ):

# gradle build

Support & Contact

Versions

Version
1.0