Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

72
Views
A String Describing the Additions, Removals and Changes Between Strings?

I've been attempting to create a version control system using strings (Files in Base64) in Javascript. I figure instead of storing every version of a file as a completely new file this will cut down on space. Instead I would like to create a chain of differences based on an original file.

For example: new_version("Hello world! My name is Bob.", "Hello world! My Papa is Sam.") should return something like ?16?P?1?pa?4?Sam?1? Where the integer represents how many spaces to skip before making a change. The issue I'm facing is words with different lengths. Replacing Sam with Bill would completely alter the remaining string. I'm wondering if there is a better way than comparing every character as I've done for my prototype.

7 months ago ยท Juan Pablo Isaza
Answer question
Find remote jobs