Giter Site home page Giter Site logo

testdiffedbinaries's Introduction

AppVeyor Build status

Features & Usage

  • The service compares two byte arrays. It checks 3 conditions: 1) if they equal, 2) have different size and 3) mismatching subsequences (only position & length) in the second (right) sequence comparing to the 1st one.
  • It assumes that can be used in parrallel by mupltiple clients. Because of that each client should operate with data slots which can be provided automatically.
  • Data to compare shall be sent to left and right endpoints before requesting a difference.
  • Data is sent as a JSON string (see below)

API Endpoints

API Version 1.0.0 All data is sent via request body. GET-requests have 60 seconds caching which can be dimissed be adding random query parameter. Below are listed endpoints with examples of requests and responses.

GET <host>/v1/diff/left
returns byte array from the left
Request: "514b3b5b-43e4-4ea5-ad2a-09e0d79e9d54"
Response: "AQID" (byte array encoded to Base64)

GET <host>/v1/diff/right
returns byte array from the left
Request: "514b3b5b-43e4-4ea5-ad2a-09e0d79e9d54"
Response: "AQID" (byte array encoded to Base64)

GET <host>/v1/diff
returns differences of two byte arrays
Request: "514b3b5b-43e4-4ea5-ad2a-09e0d79e9d54"
Response: {"AreEqual":1,"Mismatches":[{"Item1":3,"Item2":2}]}
AreEqual can have 3 values: 0 - equal, 1 - not equal, 2 - size is not equal
In Mismatches: Item1 - starting position, Item2 - length of mismatching block

POST <host>/v1/diff/left
adds left byte array
Request: {"Id":"514b3b5b-43e4-4ea5-ad2a-09e0d79e9d54", "Content":"AQID"} or {"Content":"AQID"}
Response: "514b3b5b-43e4-4ea5-ad2a-09e0d79e9d54" or new guid for created slot

POST <host>/v1/diff/right
adds right byte array
Request: {"Id":"514b3b5b-43e4-4ea5-ad2a-09e0d79e9d54", "Content":"AQID"} or {"Content":"AQID"}
Response: "514b3b5b-43e4-4ea5-ad2a-09e0d79e9d54" or new guid for created slot

PUT <host>/v1/diff/left
updateds left byte array
Request: {"Id":"514b3b5b-43e4-4ea5-ad2a-09e0d79e9d54", "Content":"AQID"}
Response: OK

PUT <host>/v1/diff/right
updates right byte array
Request: {"Id":"514b3b5b-43e4-4ea5-ad2a-09e0d79e9d54", "Content":"AQID"}
Response: OK

DELETE <host>/v1/diff/left
deletes left byte array
Request: "514b3b5b-43e4-4ea5-ad2a-09e0d79e9d54"
Response: OK

DELETE <host>/v1/diff/right
deletes right byte array
Request: "514b3b5b-43e4-4ea5-ad2a-09e0d79e9d54"
Response: OK

Also

Implemented v 1.0.0

  • simultaneous work of several clients
  • caching control on server (60 seconds by default for GET requests)

Not Implemented v 1.0.0

  • DDOS protection
  • Persistent data storage
  • non-buffered streams comparison (for large data which 2+ GB)

testdiffedbinaries's People

Contributors

xtrmstep avatar

Watchers

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