← All packages

cryptohash-sha2560.11.102.1

Fast, pure and practical SHA-256 implementation

Open the imported Cabal file ↗

bug-reports
https://github.com/haskell-hvr/cryptohash-sha256/issues
build-type
Simple
cabal-version
2.0
category
Data, Cryptography
copyright
Vincent Hanquez, Herbert Valerio Riedel
extra-source-files
cbits/hs_sha256.h changelog.md
homepage
https://github.com/haskell-hvr/cryptohash-sha256
license
BSD3
license-file
LICENSE
maintainer
Herbert Valerio Riedel <hvr@gnu.org>
name
cryptohash-sha256
synopsis
Fast, pure and practical SHA-256 implementation
tested-with
GHC == 9.12.1 GHC == 9.10.1 GHC == 9.8.4 GHC == 9.6.6 GHC == 9.4.8 GHC == 9.2.8 GHC == 9.0.2 GHC == 8.10.7 GHC == 8.8.4 GHC == 8.6.5 GHC == 8.4.4 GHC == 8.2.2
version
0.11.102.1
x-revision
6
Show the complete metadata as JSON
{
  "schemaVersion": 1,
  "name": "cryptohash-sha256",
  "version": "0.11.102.1",
  "cabalVersion": "2.0",
  "buildType": "Simple",
  "fields": {
    "bug-reports": [
      "https://github.com/haskell-hvr/cryptohash-sha256/issues"
    ],
    "build-type": [
      "Simple"
    ],
    "cabal-version": [
      "2.0"
    ],
    "category": [
      "Data, Cryptography"
    ],
    "copyright": [
      "Vincent Hanquez, Herbert Valerio Riedel"
    ],
    "description": [
      "A practical incremental and one-pass, pure API to\nthe [SHA-256 cryptographic hash algorithm](https://en.wikipedia.org/wiki/SHA-2) according\nto [FIPS 180-4](http://dx.doi.org/10.6028/NIST.FIPS.180-4)\nwith performance close to the fastest implementations available in other languages.\n.\nThe core SHA-256 algorithm is implemented in C and is thus expected\nto be as fast as the standard [sha256sum(1) tool](https://linux.die.net/man/1/sha256sum);\nfor instance, on an /Intel Core i7-3770/ at 3.40GHz this implementation can\ncompute a SHA-256 hash over 230 MiB of data in under one second.\n(If, instead, you require a pure Haskell implementation and performance is secondary, please refer to the [SHA package](https://hackage.haskell.org/package/SHA).)\n.\n.\nAdditionally, this package provides support for\n.\n- HMAC-SHA-256: SHA-256-based [Hashed Message Authentication Codes](https://en.wikipedia.org/wiki/HMAC) (HMAC)\n- HKDF-SHA-256: [HMAC-SHA-256-based Key Derivation Function](https://en.wikipedia.org/wiki/HKDF) (HKDF)\n.\nconforming to [RFC6234](https://tools.ietf.org/html/rfc6234), [RFC4231](https://tools.ietf.org/html/rfc4231), [RFC5869](https://tools.ietf.org/html/rfc5869), et al..\n.\n=== Relationship to the @cryptohash@ package and its API\n.\nThis package has been originally a fork of @cryptohash-0.11.7@ because the @cryptohash@\npackage had been deprecated and so this package continues to satisfy the need for a\nlightweight package providing the SHA-256 hash algorithm without any dependencies on packages\nother than @base@ and @bytestring@. The API exposed by @cryptohash-sha256-0.11.*@'s\n\"Crypto.Hash.SHA256\" module is guaranteed to remain a compatible superset of the API provided\nby the @cryptohash-0.11.7@'s module of the same name.\n.\nConsequently, this package is designed to be used as a drop-in replacement for @cryptohash-0.11.7@'s\n\"Crypto.Hash.SHA256\" module, though with\na [clearly smaller footprint by almost 3 orders of magnitude](https://www.reddit.com/r/haskell/comments/5lxv75/psa_please_use_unique_module_names_when_uploading/dbzegx3/)."
    ],
    "extra-source-files": [
      "cbits/hs_sha256.h\nchangelog.md"
    ],
    "homepage": [
      "https://github.com/haskell-hvr/cryptohash-sha256"
    ],
    "license": [
      "BSD3"
    ],
    "license-file": [
      "LICENSE"
    ],
    "maintainer": [
      "Herbert Valerio Riedel <hvr@gnu.org>"
    ],
    "name": [
      "cryptohash-sha256"
    ],
    "synopsis": [
      "Fast, pure and practical SHA-256 implementation"
    ],
    "tested-with": [
      "GHC == 9.12.1\nGHC == 9.10.1\nGHC == 9.8.4\nGHC == 9.6.6\nGHC == 9.4.8\nGHC == 9.2.8\nGHC == 9.0.2\nGHC == 8.10.7\nGHC == 8.8.4\nGHC == 8.6.5\nGHC == 8.4.4\nGHC == 8.2.2"
    ],
    "version": [
      "0.11.102.1"
    ],
    "x-revision": [
      "6"
    ]
  },
  "components": [
    {
      "kind": "library",
      "name": "main",
      "tree": {
        "data": {
          "buildable": null,
          "exposedModules": [
            "Crypto.Hash.SHA256"
          ],
          "otherModules": [],
          "dependencies": [
            {
              "package": "base",
              "range": ">=4.5 && <5",
              "libraries": [
                "main"
              ]
            }
          ],
          "fields": {}
        },
        "branches": [
          {
            "condition": {
              "flag": "use-cbits"
            },
            "then": {
              "data": {
                "buildable": null,
                "exposedModules": [],
                "otherModules": [
                  "Crypto.Hash.SHA256.FFI",
                  "Compat"
                ],
                "dependencies": [
                  {
                    "package": "bytestring",
                    "range": "^>=0.9.2.0 || ^>=0.10.0.0 || ^>=0.11.0.0 || ^>=0.12.0.2",
                    "libraries": [
                      "main"
                    ]
                  }
                ],
                "fields": {}
              },
              "branches": []
            },
            "else": {
              "data": {
                "buildable": null,
                "exposedModules": [],
                "otherModules": [],
                "dependencies": [
                  {
                    "package": "cryptohash-sha256-pure",
                    "range": "^>=0.1.0",
                    "libraries": [
                      "main"
                    ]
                  }
                ],
                "fields": {}
              },
              "branches": []
            }
          }
        ]
      }
    },
    {
      "kind": "executable",
      "name": "sha256sum",
      "tree": {
        "data": {
          "buildable": null,
          "exposedModules": [],
          "otherModules": [],
          "dependencies": [],
          "fields": {}
        },
        "branches": [
          {
            "condition": {
              "flag": "exe"
            },
            "then": {
              "data": {
                "buildable": null,
                "exposedModules": [],
                "otherModules": [],
                "dependencies": [
                  {
                    "package": "cryptohash-sha256",
                    "range": "-any",
                    "libraries": [
                      "main"
                    ]
                  },
                  {
                    "package": "base",
                    "range": "-any",
                    "libraries": [
                      "main"
                    ]
                  },
                  {
                    "package": "bytestring",
                    "range": "-any",
                    "libraries": [
                      "main"
                    ]
                  },
                  {
                    "package": "base16-bytestring",
                    "range": "^>=0.1.1 || ^>=1.0.0",
                    "libraries": [
                      "main"
                    ]
                  }
                ],
                "fields": {}
              },
              "branches": []
            },
            "else": {
              "data": {
                "buildable": false,
                "exposedModules": [],
                "otherModules": [],
                "dependencies": [],
                "fields": {}
              },
              "branches": []
            }
          }
        ]
      }
    },
    {
      "kind": "test-suite",
      "name": "test-sha256",
      "tree": {
        "data": {
          "buildable": null,
          "exposedModules": [],
          "otherModules": [],
          "dependencies": [
            {
              "package": "cryptohash-sha256",
              "range": "-any",
              "libraries": [
                "main"
              ]
            },
            {
              "package": "base",
              "range": "-any",
              "libraries": [
                "main"
              ]
            },
            {
              "package": "bytestring",
              "range": "-any",
              "libraries": [
                "main"
              ]
            },
            {
              "package": "base16-bytestring",
              "range": "^>=0.1.1 || ^>=1.0.0",
              "libraries": [
                "main"
              ]
            },
            {
              "package": "SHA",
              "range": "^>=1.6.4",
              "libraries": [
                "main"
              ]
            },
            {
              "package": "tasty",
              "range": "^>=1.4 || ^>=1.5",
              "libraries": [
                "main"
              ]
            },
            {
              "package": "tasty-quickcheck",
              "range": ">=0.10 && <1",
              "libraries": [
                "main"
              ]
            },
            {
              "package": "tasty-hunit",
              "range": "^>=0.10",
              "libraries": [
                "main"
              ]
            }
          ],
          "fields": {
            "type": [
              "exitcode-stdio-1.0"
            ]
          }
        },
        "branches": []
      }
    },
    {
      "kind": "benchmark",
      "name": "bench-sha256",
      "tree": {
        "data": {
          "buildable": null,
          "exposedModules": [],
          "otherModules": [],
          "dependencies": [
            {
              "package": "cryptohash-sha256",
              "range": "-any",
              "libraries": [
                "main"
              ]
            },
            {
              "package": "SHA",
              "range": "^>=1.6.4",
              "libraries": [
                "main"
              ]
            },
            {
              "package": "base",
              "range": "-any",
              "libraries": [
                "main"
              ]
            },
            {
              "package": "bytestring",
              "range": "-any",
              "libraries": [
                "main"
              ]
            },
            {
              "package": "criterion",
              "range": "^>=1.5 || ^>=1.6",
              "libraries": [
                "main"
              ]
            }
          ],
          "fields": {
            "type": [
              "exitcode-stdio-1.0"
            ]
          }
        },
        "branches": []
      }
    }
  ],
  "setupDependencies": [],
  "flags": [
    {
      "name": "exe",
      "default": false,
      "manual": true,
      "description": "Enable building @sha256sum@ executable"
    },
    {
      "name": "use-cbits",
      "default": true,
      "manual": true,
      "description": "Use fast optimized C routines via FFI; if flag is disabled falls back to non-FFI Haskell optimized implementation."
    }
  ],
  "sourceRepositories": [
    {
      "kind": "head",
      "fields": {
        "location": [
          "https://github.com/haskell-hvr/cryptohash-sha256.git"
        ],
        "type": [
          "git"
        ]
      }
    }
  ],
  "warnings": [],
  "sourceUrl": "https://hackage.haskell.org/package/cryptohash-sha256-0.11.102.1/cryptohash-sha256.cabal",
  "sha256": "0e9de2ccce261e7a5b027e842f6f47f50eb0e6059a0de98a5479f75aa8164107",
  "importedAt": "2026-10-14T12:40:56.117Z",
  "dependencies": [
    {
      "package": "base",
      "range": ">=4.5 && <5",
      "libraries": [
        "main"
      ],
      "component": "library:main",
      "conditions": []
    },
    {
      "package": "bytestring",
      "range": "^>=0.9.2.0 || ^>=0.10.0.0 || ^>=0.11.0.0 || ^>=0.12.0.2",
      "libraries": [
        "main"
      ],
      "component": "library:main",
      "conditions": [
        {
          "flag": "use-cbits"
        }
      ]
    },
    {
      "package": "cryptohash-sha256-pure",
      "range": "^>=0.1.0",
      "libraries": [
        "main"
      ],
      "component": "library:main",
      "conditions": [
        {
          "not": {
            "flag": "use-cbits"
          }
        }
      ]
    },
    {
      "package": "cryptohash-sha256",
      "range": "-any",
      "libraries": [
        "main"
      ],
      "component": "executable:sha256sum",
      "conditions": [
        {
          "flag": "exe"
        }
      ]
    },
    {
      "package": "base",
      "range": "-any",
      "libraries": [
        "main"
      ],
      "component": "executable:sha256sum",
      "conditions": [
        {
          "flag": "exe"
        }
      ]
    },
    {
      "package": "bytestring",
      "range": "-any",
      "libraries": [
        "main"
      ],
      "component": "executable:sha256sum",
      "conditions": [
        {
          "flag": "exe"
        }
      ]
    },
    {
      "package": "base16-bytestring",
      "range": "^>=0.1.1 || ^>=1.0.0",
      "libraries": [
        "main"
      ],
      "component": "executable:sha256sum",
      "conditions": [
        {
          "flag": "exe"
        }
      ]
    },
    {
      "package": "cryptohash-sha256",
      "range": "-any",
      "libraries": [
        "main"
      ],
      "component": "test-suite:test-sha256",
      "conditions": []
    },
    {
      "package": "base",
      "range": "-any",
      "libraries": [
        "main"
      ],
      "component": "test-suite:test-sha256",
      "conditions": []
    },
    {
      "package": "bytestring",
      "range": "-any",
      "libraries": [
        "main"
      ],
      "component": "test-suite:test-sha256",
      "conditions": []
    },
    {
      "package": "base16-bytestring",
      "range": "^>=0.1.1 || ^>=1.0.0",
      "libraries": [
        "main"
      ],
      "component": "test-suite:test-sha256",
      "conditions": []
    },
    {
      "package": "SHA",
      "range": "^>=1.6.4",
      "libraries": [
        "main"
      ],
      "component": "test-suite:test-sha256",
      "conditions": []
    },
    {
      "package": "tasty",
      "range": "^>=1.4 || ^>=1.5",
      "libraries": [
        "main"
      ],
      "component": "test-suite:test-sha256",
      "conditions": []
    },
    {
      "package": "tasty-quickcheck",
      "range": ">=0.10 && <1",
      "libraries": [
        "main"
      ],
      "component": "test-suite:test-sha256",
      "conditions": []
    },
    {
      "package": "tasty-hunit",
      "range": "^>=0.10",
      "libraries": [
        "main"
      ],
      "component": "test-suite:test-sha256",
      "conditions": []
    },
    {
      "package": "cryptohash-sha256",
      "range": "-any",
      "libraries": [
        "main"
      ],
      "component": "benchmark:bench-sha256",
      "conditions": []
    },
    {
      "package": "SHA",
      "range": "^>=1.6.4",
      "libraries": [
        "main"
      ],
      "component": "benchmark:bench-sha256",
      "conditions": []
    },
    {
      "package": "base",
      "range": "-any",
      "libraries": [
        "main"
      ],
      "component": "benchmark:bench-sha256",
      "conditions": []
    },
    {
      "package": "bytestring",
      "range": "-any",
      "libraries": [
        "main"
      ],
      "component": "benchmark:bench-sha256",
      "conditions": []
    },
    {
      "package": "criterion",
      "range": "^>=1.5 || ^>=1.6",
      "libraries": [
        "main"
      ],
      "component": "benchmark:bench-sha256",
      "conditions": []
    }
  ],
  "exposedModules": [
    "Crypto.Hash.SHA256"
  ],
  "documents": {
    "readme": {
      "status": "missing",
      "sha256": null,
      "error": null,
      "checkedAt": "2026-10-14T12:40:56.849Z"
    },
    "changelog": {
      "status": "available",
      "sha256": "b51a68b0e6fae277fe9f734981d83b4a5ef1ad96754d73921e4413b3f8dc6d9a",
      "error": null,
      "checkedAt": "2026-10-14T12:40:56.970Z"
    }
  },
  "documentation": null,
  "versions": [
    {
      "version": "0.11.102.1",
      "imported_at": "2026-10-14T12:40:56.117Z"
    }
  ]
}

Import a package

Enter a package name and an exact version from Hackage. The site contains imported versions only.