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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tch1

v1.0.1

Published

A custom TCH1 language (created by TurboChat) hash creator. Disclaimer: This is not the most secure option. Please use other official langauges for the most secure option.

Downloads

137

Readme

TCH1.js Documentation

Welcome to the documentation for TCH1.js, a custom one-way hash encrypter built using the TCH1 language. This tool allows you to securely hash input strings without relying on external libraries, making it lightweight and easy to integrate into your projects.


Disclaimer

TCH1.js is an experimental tool intended for educational and non-critical applications. For more secure and robust hashing solutions, it is recommended to use official cryptographic libraries and established standards.


Table of Contents

  1. How to Use
  2. Function Breakdown
  3. Example Code
  4. Frequently Created Bugs
  5. Additional Information
  6. More Resources

How to Use

Install via npm

To use TCH1.js in your project, install it using npm:

```bash npm install tch1 ```


Import TCH1.js into Your Project

For CommonJS (Node.js)

```javascript const TCH1 = require('tch1');

const input = "hello world"; const hash = TCH1.hash(input); console.log("Hash:", hash); ```

For ES Modules

```javascript import TCH1 from 'tch1';

const input = "hello world"; const hash = TCH1.hash(input); console.log("Hash:", hash); ```

Using TCH1.js in Browser with Module Bundlers

```javascript import TCH1 from 'tch1';

const input = "hello world"; const hash = TCH1.hash(input); console.log("Hash:", hash); ```


Using TCH1.js Directly in Websites

Include TCH1.js by referencing the local `tch1.js` file:

```html

```


Function Breakdown

  • hash(input, salt, rounds): Generates a one-way hash of the input string.

    Parameters:

    • input: `string` - The input string you want to hash.
    • salt: `string (optional)` - A custom salt to add randomness to the hash. If not provided, a fixed default salt is used.
    • rounds: `number (optional)` - The number of hashing iterations to increase complexity. Default is `1000`.

    Returns: `string` - A fixed-length hash string.


Example Code

Here are some examples demonstrating how to use the `TCH1.hash` function:

1. Basic Hashing

```javascript const TCH1 = require('tch1');

const input = "hello world"; const hash = TCH1.hash(input); console.log("Hash:", hash); ```

2. Custom Salt and Rounds

```javascript const TCH1 = require('tch1');

const input = "securePassword"; const customSalt = "MyS@lt12345"; const customRounds = 500; const hash = TCH1.hash(input, customSalt, customRounds); console.log("Custom Hash:", hash); ```

3. Using TCH1.js in Browser

```html

```


Frequently Created Bugs

1. "TCH1 is not defined."

Cause: The `tch1.js` file is not correctly included or imported in your project.

Solution: ```javascript // For CommonJS const TCH1 = require('tch1');

// For ES Modules import TCH1 from 'tch1'; ```


2. "Hash function is not returning the expected length."

Cause: The `HASH_LENGTH` in `tch1.js` might have been modified.

Solution: Verify that the `HASH_LENGTH` is set to your desired fixed size (default is 32 characters).


Additional Information

The `TCH1.hash` function provides a simple and efficient way to generate deterministic one-way hashes for your applications. It's lightweight and doesn't require any external dependencies, making it ideal for projects where minimizing dependencies is crucial.

For more advanced features or to customize the hashing process further, you can modify the `tch1.js` file to suit your specific requirements.


More Resources

Check out the API Overview for a deeper dive into available functions and customization options.


Feel free to explore and enhance TCH1.js to better fit your project's needs!