Giter Site home page Giter Site logo

js-crypto's Introduction

JavaScript Hash Functions

Some JavaScript implementations of common hash functions (MD5, SHA-1 and SHA-256) designed to be compressed into the smallest size possible.

I can't entirely guarantee that they'll absolutely always work exactly as they should, so it's probably not the best idea to use them in anything absolutely mission-critical. That said, they do seem to work fine for me wherever I use them. And if you do find something wrong, open an issue on GitHub and I'll do my best to fix it.

Licence and Usage

These scripts are licensed under the โ˜บ licence, so basically you're free to use them however you please - feel free to use or modify them in whatever way you like. You don't have to explicitly credit me (but if you do then I won't complain), but just don't pass them off as entirely your own, ok? That's just not cool.

But Why?

To begin with, because I needed a smallish MD5 that wasn't poorly written (lots of the others out there leaked globals), but nowadays it's pretty much just because I can.

And How?

Well, I started out with a mashup of the pseudocode on the respective wikipedia pages for the functions along with helper functions I found somewhere on the internet for converting strings to byte arrays etc, then bashed them every which-way I could with functionally-equivalent rearrangements to make the size smaller however I could think. Just don't try to get me to explain what any of it does any more.

Shout out to RyanC for spotting a couple of bugs where I'd been a moron and over-optimised.

js-crypto's People

Contributors

duzun avatar heavensrevenge avatar jbt avatar ryancdotorg avatar

Watchers

 avatar

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.