Comments (5)
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.
@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.
@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.
LGTM
from deno-playground.
merged, and thanks for the pointers!
from deno-playground.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deno-playground.