Giter Club home page Giter Club logo

Comments (5)

maman avatar maman commented on July 18, 2024

good catch!

hmm, this can be mitigated by storing the "hash" for each shared codes, and perform hash - checking first on the API-side when there's a request to share

hmm, also I should trim the source code first before performing hash-checking/storing them to db 🤔

do you have any comments/suggestions @husniadil ?

from deno-playground.

husniadil avatar husniadil commented on July 18, 2024

@maman I think we shouldn't trim the code, better to leave it as it is.
We can try to generate code hash, for example by using sha256, and then encode the result into base64.

You may add some post processing by removing last underscore (in order to make the share-url not like suspicious).

from deno-playground.

maman avatar maman commented on July 18, 2024

@husniadil the code-trimming should be necessary so it can handles spamming such as this:

console.log(Deno);
=============
console.log(Deno);<space><space>

for those cases, both code snippets will be resolved to a same share ID, thus further preventing persistence thrashing.

Regarding the sha256 + base64 combination, I've implemented them on #8 - feel free to check the preview deployment there 😄

from deno-playground.

husniadil avatar husniadil commented on July 18, 2024

LGTM

from deno-playground.

maman avatar maman commented on July 18, 2024

merged, and thanks for the pointers!

from deno-playground.

Related Issues (5)

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.