npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@reventlessdev/rescript-hash-object

v1.2.0-alpha.11

Published

ReScript bindings for hash-object

Readme

npm License: Apache-2.0 Docs

@reventlessdev/rescript-hash-object

⚠️ Alpha. APIs and on-disk formats can change without notice between releases. Pin exact versions and expect breaking changes.

ReScript bindings for hash-obj.

Install

pnpm add @reventlessdev/rescript-hash-object

Add it to your rescript.json dependencies:

{
  "dependencies": ["@reventlessdev/rescript-hash-object"]
}

API Documentation

hashDict

Generates a hash string from a dictionary object.

hashDict: (~dict: dict<string>, ~options: Options.t=?) => string

Parameters:

  • dict: A dictionary with string values to hash
  • options (optional): Configuration options for hash generation

Options

type Options.t = {
  encoding?: encoding,
  algorithm?: algorithm,
}

encoding - Output encoding format:

  • Hex (default) - Hexadecimal string
  • Base64 - Base64-encoded string
  • Buffer - Raw buffer output
  • Latin1 - Latin1 string encoding

algorithm - Hash algorithm to use:

  • SHA256 (default) - SHA-256 algorithm
  • MD5 - MD5 algorithm
  • SHA1 - SHA-1 algorithm
  • SHA512 - SHA-512 algorithm

Examples

Basic usage (default SHA256 with hex encoding)

open HashObj

let data = Dict.fromArray([("name", "Alice"), ("age", "30")])
let hash = hashDict(~dict=data)
// => "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918"

Using different algorithms

open HashObj

let data = Dict.fromArray([("user", "bob"), ("id", "42")])

// MD5
let md5Hash = hashDict(~dict=data, ~options={algorithm: MD5})

// SHA1
let sha1Hash = hashDict(~dict=data, ~options={algorithm: SHA1})

// SHA512
let sha512Hash = hashDict(~dict=data, ~options={algorithm: SHA512})

Using different encodings

open HashObj

let data = Dict.fromArray([("key", "value")])

// Hex encoding (default)
let hexHash = hashDict(~dict=data, ~options={encoding: Hex})

// Base64 encoding
let base64Hash = hashDict(~dict=data, ~options={encoding: Base64})

// Latin1 encoding
let latin1Hash = hashDict(~dict=data, ~options={encoding: Latin1})

Combining algorithm and encoding

open HashObj

let data = Dict.fromArray([
  ("environment", "production"),
  ("version", "1.2.3"),
  ("region", "us-east-1"),
])

// SHA512 with Base64 encoding
let hash = hashDict(
  ~dict=data,
  ~options={
    algorithm: SHA512,
    encoding: Base64,
  },
)

Links

License

Apache-2.0