Coder Social home page Coder Social logo

connected-data-store's Introduction

Connected Data Store : Create a Connected Data Store : Create and implement a data structure similar to a blockchain based on the below requirements.

Stage 1: Create a Connected Data Store

Requirements:

Data Store Object Structure:

  • Each data store object should have:
    • Index: Unique identifier for the object.
    • Data: Maximum of 1024 bytes of characters.
    • Prev Hash: Hash of the previous data store object.
    • Current Hash: Hash generated based on cryptographic algorithm using Index, Data, and Prev Hash.

Initial Block:

  • The first block should have 0000 as the Prev Hash.

Steps:

  1. Define the data store object structure with the specified properties.
  2. Implement a method to generate the hash of a data store object based on the cryptographic algorithm and input parameters.
  3. Create the initial block with 0000 as the Prev Hash.

Stage 2: Correction State

Requirements:

Correct Data Store Object:

  • A data store object is considered correct if its hash follows a specified pattern (e.g., first 4 digits are zero).
  • Addition of a Correction Value field in the object.

Correction Value Calculation:

  • The Correction Value should be calculated in such a way that when combined with other fields, it produces a hash with the specified pattern.

Hash Update:

  • Ability to find a particular object's Correction Value.
  • Update the object's hash based on the new Correction Value.

Recalculation Trigger:

  • Updating any field in a data store object should trigger a recalculation of the hash.
  • Recalculation should propagate to further connected data store objects.

Steps:

  1. Add a Correction Value field to the data store object.
  2. Implement a method to calculate the Correction Value for an object to meet the specified hash pattern.
  3. Update the hash of the object based on the new Correction Value.
  4. Implement a function to find a particular object's Correction Value and update its hash.
  5. Ensure that updating any field triggers hash recalculation and cascades to connected data store objects.

The solution can be created on any tech stack. Create a fork of this repository and build your solution on the fork and share the forked repository address over email in the stipulated time.

connected-data-store's People

Contributors

adreno-abhi avatar dineshjnld 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.