GithubHelp home page GithubHelp logo

tiny-hashes's Introduction

Tiny Hash Functions

Some super-tiny implementations of common hash functions (MD5, SHA-1 and SHA-256).

Installation

From npm:

npm i tiny-hashes

Usage

Preferably using ES modules:

import md5 from 'tiny-hashes/md5';
import sha1 from 'tiny-hashes/sha1';
import sha256 from 'tiny-hashes/sha256';

md5('hello, world'); // "e4d7f1b4ed2e42d15898f4b27b019da4", hopefully

sha1('hello, world'); // "b7e23ec29af22b0b4e41da31e868d57226121c84", hopefully

sha256('hello, world'); // "09ca7e4eaa6e8ae9c7d261167129184883644d07dfba7cbfbc4c8a2e08360d5b", hopefully

Other ways of importing

The following styles should also all work, but may be less-friendly to tree-shaking:

const md5 = require('tiny-hashes/md5');
const sha1 = require('tiny-hashes/sha1');
const sha256 = require('tiny-hashes/sha256');

import { md5, sha1, sha256 } from 'tiny-hashes';

const { md5, sha1, sha256 } = require('tiny-hashes');

When should you use this?

Please don't use this if you absolutely rely on it being correct. There are more solid solutions out there.

Please also don't use this server-side in Node.js - the crypto build-in module exists for a reason.

Basically only use this if you want a super-duper-tiny hash function in the browser that you can be about 99% sure is correct and should always be self-consistent.

tiny-hashes's People

Contributors

duzun avatar heavensrevenge avatar jbt avatar ryancdotorg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tiny-hashes's Issues

License?

Hey @jbt thank for this wonderful library, it's exactly what I need.

One thing before I can use it though: can you specify its license please?

AMD compliant version

Do you plan to make these modules AMD and possibly CommonJS compliant?

I like the idea of tiny JS.

Good job โ˜บ !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.