Giter VIP home page Giter VIP logo

signedness-checker-2's Introduction

This repo contains the Annotated and unannotated version of code which force a file’s CRC to any value i.e. on https://www.nayuki.io/page/forcing-a-files-crc-to-any-value

To compile from terminal, following command needs to be passed :

javac -processor signedness forcecrc32.java

In this case study I learnt that signedness checker is weak in some classes and needs enhancements such as:-

1.)java.lang.Integer- reverse function

3.)java.io.RandomAccessFile

and I think many more in the future too.

When you will compile this file using signedness checker these errors will come-

java:102: error: [comparison.unsignedlhs] comparison has an unsigned LHS
			if (offset + 4 > raf.length())
			           ^
java:114: error: [operation.mixed.unsignedrhs] MINUS operation on signed LHS and unsigned RHS values
      delta = (int)multiplyMod(reciprocalMod(powMod(2, (raf.length() - offset) * 8)), delta & 0xFFFFFFFFL);
			                                                               ^
java:114: error: [argument.type.incompatible] incompatible types in argument.
      delta = (int)multiplyMod(reciprocalMod(powMod(2, (raf.length() - offset) * 8)), delta & 0xFFFFFFFFL);
			                                                                         ^
  found   : @UnknownSignedness long
  required: @Unsigned long
java:118: error: [argument.type.incompatible] incompatible types in argument.
	    raf.seek(offset);
			         ^
  found   : @Unsigned long
  required: @Signed long
java:123: error: [argument.type.incompatible] incompatible types in argument.
	    raf.readFully(bytes4);
			              ^
  found   : @Unsigned byte @UnknownSignedness []
  required: @Signed byte @UnknownSignedness []
java:128: error: [argument.type.incompatible] incompatible types in argument.
			raf.seek(offset);
			         ^
  found   : @Unsigned long
  required: @Signed long

These errors shows the weakness in signedness checker.

Due to this errors came and in someplaces I had to @SuppressWarnings. I would not have found these problems in signedness checker without doing this case study. Will further analyze this checker where it needs more enhancements.

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.