Archive | JS

RSS feed for this section

RC4+ stream cipher implement in PHP and Javascript

RC4+ is a modified version of RC4 with a more complex three-phase key schedule (taking about 3× as long as RC4, or the same as RC4-drop512), and a more complex output function which performs four additional lookups in the S array for each byte output, taking approximately 1.7× as long as basic RC4. We provide […]

Read full story Comments { 1 }

VMPC stream cipher implement in PHP and Javascript

VMPC (Variably Modified Permutation Composition) is a stream cipher similar to the well known and popular cipher RC4 designed by Ron Rivest. It was designed by Bartosz Zoltak, presented in 2004 at the Fast Software Encryption conference. VMPC is a modification of the RC4 cipher. We provide some function of VMPC stream cipher implement in […]

Read full story Comments { 1 }

RC4A cipher implement in PHP and Javascript

RC4A is one of RC4 variants. Souradyuti Paul and Bart Preneel have proposed an RC4 variant, which they call RC4A. We provide some function implement of RC4A cipher in PHP and Javascript: PHP Example: Result: Javascript Example: Result: Try it yourself

Read full story Comments { 1 }

RC4 implementation in PHP and Javascript

In cryptography, RC4 (Rivest Cipher 4 also known as ARC4 or ARCFOUR meaning Alleged RC4, see below) is a stream cipher. We provide some function RC4 in PHP and Javascript PHP: JS: Example: Result: Try it yourself Some RC4 variants RC4A cipher implement in PHP and Javascript VMPC stream cipher implement in PHP and Javascript […]

Read full story Comments { 0 }

Example chat application using Nodejs + ws

Previous tutorial: Example chat application using Nodejs + Websocket With Nodejs, we can create real-time application like chat-room. We can use Socket.io, WS or Websocket. Today, we introduce a simple chat application with Nodejs + Websocket Application structure: File index.html File client.js File server.js Run: npm install ws to install ws Run: node server.js Go […]

Read full story Comments { 0 }

Example chat application using Nodejs + Websocket

Previous tutorial: Example chat application using Nodejs + Socket.io With Nodejs, we can create real-time application like chat-room. We can use Socket.io, WS or Websocket. Today, we introduce a simple chat application with Nodejs + Websocket Application structure: File index.html File chat-frontend.js File: chat-server.js Run: npm install websocket to install Websocket Run: node chat-server.js Go […]

Read full story Comments { 0 }

Example chat application using Nodejs + Socket.io

With Nodejs, we can create real-time application like chat-room. We can use Socket.io, WS or Websocket. Today, we introduce a simple chat application with Nodejs + Socket.io Application structure: File: package.json File: index.html File: app.js Run: node app.js Go to website: http://localhost:443/ Next tutorial: Example chat application using Nodejs + Websocket

Read full story Comments { 1 }

PHP array_filter base on keys in JavaScript

We can find the PHP array_filter in JavaScript in http://jsphp.co/jsphp/fn/view/array_filter But you can’t use it for find by values. array_filter flag: Flag determining what arguments are sent to callback: ARRAY_FILTER_USE_KEY – pass key as the only argument to callback instead of the value ARRAY_FILTER_USE_BOTH – pass both value and key as arguments to callback instead […]

Read full story Comments are closed

PHP: how to use AJAX to upload file

We create a simple example to learn how to use AJAX to upload file. HTML Create simple form with a file input, we use accept attribute to validate image Javascript: PHP: file testuploadajaxdo.php We use folder products to store all uploaded images. Done 😀 Demo online: Demo upload ajax

Read full story Comments { 0 }

How to create a download button in Jwplayer

Step 1: First, we need to use a download image: here Step 2: Setup jwplayer HTML: JS: Step 3: add download button Here is the online demo: http://demo.tutorialspots.com/jwplayer/jw1.html But, if we use playerInstance.getPlaylistItem()[‘file’], we only download the first source file in the currently playing playlist. How to download the current video? Here is the solution: […]

Read full story Comments { 0 }