Skip to content

Commit

Permalink
=readme and such
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox committed Jan 11, 2018
1 parent 020a3b9 commit 9a13fe7
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
3 changes: 2 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
The MD5.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2018: Lyndon White.
> Copyright (c) 2014: Elliot Saba. (SHA.jl)
> Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm, Copyright (C) 1991-2
>
>
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
Expand Down
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,49 @@
[![Coverage Status](https://coveralls.io/repos/oxinabox/MD5.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/oxinabox/MD5.jl?branch=master)

[![codecov.io](http://codecov.io/github/oxinabox/MD5.jl/coverage.svg?branch=master)](http://codecov.io/github/oxinabox/MD5.jl?branch=master)


A pure julia MD5 implementation.
There is few reasons to create new MD5 checksums, but there are a huge number of existing ones.
Honestly, just use SHA-256 for everything you would use MD5 for.
MD5 is not secure, and it's not faster, and it doesn't have much going for it.


With that said, this is an MD5 implementation.

It directly extends [SHA.jl](https://github.com/staticfloat/SHA.jl).
Using a lot of the same underlying functionality, and it's interface.

Just like the functions from SHA.jl
`md5` takes either an `Array{UInt8}`, a `String`, or an `IO` object.
This makes it trivial to checksum a file.


```
julia> using MD5
julia> bytes2hex(md5("test"))
"098f6bcd4621d373cade4e832627b4f6"
julia> String(read("test.txt"))
"test\n"
julia> open(md5, "test.txt")
16-element Array{UInt8,1}:
0xd8
0xe8
0xfc
0xa2
0xdc
0x0f
0x89
0x6f
0xd7
0xcb
0x4c
0xb0
0x03
0x1b
0xa2
0x49
```
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
julia 0.6
SHA
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using MD5
using Base.Test

@testset "String Mests" begin
@testset "String Tests" begin
# From the reference https://tools.ietf.org/html/rfc1321 (final page)
@test bytes2hex(md5("")) == "d41d8cd98f00b204e9800998ecf8427e"
@test bytes2hex(md5("a")) == "0cc175b9c0f1b6a831c399e269772661"
Expand Down

0 comments on commit 9a13fe7

Please sign in to comment.