Giter VIP home page Giter VIP logo

tomd5's Introduction

tomd5

As a challenge to myself I wanted to implement the MD5 hashing algorithm in batch. The project is not finished and currently is not under active development.

The code

What was done

For the initial binary integer part of the sines of integers, witch would be something similar to:

for i from 0 to 63
    K[i] := floor(232 × abs(sin(i + 1)))
end for

I chose to precomputed and set the table.

This could have been done in batch, quite easelly actually, as there are many brave developers who tested their nervs and implemented all the necesary functions such as sin(x) and cos(x) in batch.

Several helper functions where needed and implemented:

  • a function that does unsigned right shift rfrs
  • as batch currently works with 32 bits signed integers only, a function to cast a value to a signed C2 byte was needed byte_cast

Reading the content of a file as hex is done using a trick with the Windows FC tool. Although this is not the chosen idiom of pure batch it is reasonably close enough.

Please remember, there are no arrays in batch. Arrays are mimicked using variables with array names. Example only the following variable declarations are fine vector[0] and vectori[7]. Think of them as declaring vector_1 and vector_7.

TODO

  • the limitations regarding code blocks in parentheses ( ) have stopped me. I see the need for a double EnableDelayedExpansion. This may be mitigated using batch calls to other functions where the operation occurs. Must experiment to verify.

  • at this point the code sets up the initial variables needed and reads the file as bytes to the message variable.

Resources

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.