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 🙏

© 2024 – Pkg Stats / Ryan Hefner

hash160

v0.0.5

Published

hash160

Downloads

17

Readme



GitHub license npm npm Github Stars


Hash160 Calculator

This JavaScript module allows you to easily calculate the Hash160 of a given input data. The Hash160 is a common hashing operation used in blockchain technologies, involving two steps: a SHA-256 hash, followed by a RIPEMD-160 hash. This module uses the SHA-256 and RIPEMD-160 functions from the skypack.dev CDN.

Installation

There's no installation required! Since the dependencies are linked through Skypack, you only need to import the module in your JavaScript project to utilize the hash160 function.

Usage

Here's a simple usage example:

import hash160 from 'hash160'

async function example() {
  const data = 'Your input data here'
  const result = await hash160(data)
  console.log(`Hash160 of "${data}" is: ${result}`)
}

example()

Function hash160 takes a string or a Uint8Array as input and returns a promise that resolves to the calculated hash in a hex-encoded string format.

Example of Converting String Data:

const hashResult = await hash160('Example Data')

Example of Converting Uint8Array Data:

const encoder = new TextEncoder()
const data = encoder.encode('Example Data')
const hashResult = await hash160(data)

Demo

Check out the index.html file in the repository for a simple and interactive web demo illustrating the use of the hash160 function. Simply input the text you'd like to hash, and see the Hash160 calculated in real-time. Try it here.

Try it out:

  • Clone the repository
  • Open main.html in your preferred browser
  • Input the text you'd like to hash
  • The Hash160 result will be displayed below the input field.

Dependencies

Contributing

We welcome contributions! Please feel free to submit a pull request with any improvements.

License

This project is released under MIT License.