Git Product home page Git Product logo

imghash's Introduction

Image Hash

This is just a quick concept that I messed around with. Basically, this is a visualization of sha384 hash.

The alorithm is extremely simple.

  1. Take the SHA384 Hash of the given text string. (line 12) Here, I made the decision to take the hash of the lowercase string so as to avoid different hashes for different capitalizations of the same string.

  2. Split the hash string into a set of tuples each of length 3 (line 14) This is not as complicated as it seems. Here is an example.
    `
    String = "abcdefghi"

    Map = [
    ( a, b, c ) ( d, e, f ) ( g, h, i ) ] `

  3. Loop through each tuple and use each of the three values as colors (line 21) This section is also really simple as SHA384 outputs 48 bytes. In tuples of 3, this is 16 values. I just represent this as 16 boxes each the color made by the values of the bytes in the tuples.

To run this simply run

` python imghash.py <text to hash>`

This will output a file that is <text to has>.png

imghash's People

Contributors

akshaykarthik avatar

Watchers

James Cloos avatar mokosd avatar  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.