Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 59 lines (40 sloc) 1.835 kb
cde9d657 »
2011-09-21 switch to markdown for the README.
1 CryptoHash
2 ==========
3
4 hs-cryptohash provides lots of different secure digest algorithms, also
5 called cryptohashes. It exposes every common hashes, but also some
6 more exotic hashes, provides an extensive list of hashes available
7 with a consistant API.
8
9 The general performance are comparable to the most optimised hashes
10 available.
11
12 The complete list of supported hashes:
13
14 * MD2, MD4, MD5
15 * RIPEMD160
16 * SHA1
17 * SHA-2 family: 224, 256, 384, 512 and the newer 512t
18 * Skein: 256, 512
19 * Tiger
20
21 You can easily import any hash with the following:
22
23 import qualified Crypto.Hash.<HASH> as <Hash>
24
25 suggestion: it's easier to import qualified since there's
26 a collision with the init symbol, but for only importing
27 the hash or hashlazy function there's no such need.
28
29 Every hashes, exposes a very similar API.
30
31 = Incremental API
32
33 it's based on 3 different functions, similar to the lowlevel operations
34 of a typical hash:
35
36 * init: create a new hash context
37 * update: update non-destructively a new hash context with a strict bytestring
38 * finalize: finalize the context and returns a digest bytestring.
39
40 all those operations are completely pure, and instead of changing the
41 context as usual in others language, it create a new context each time.
42
43 = One Pass API
44
45 The one pass API use the incremental API under the hood, but expose
46 common operations to create digests out of a bytestring and lazy bytestring.
47
48 * hash: create a digest (init+update+finalize) from a strict bytestring
49 * hashlazy: create a digest (init+update+finalize) from a lazy bytestring
50
51 = Integration with crypto-api
52
53 cryptohash is fully integrated with crypto-api and you can use the
54 related function in crypto-api to use any cryptohash modules.
55
56 = Performance
57
58 Cryptohash uses C implementations to provides maximum performance.
59 see the cbits directory for more information
Something went wrong with that request. Please try again.