This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<script> | |
const srcAssigner = () => { | |
const myframe = document.getElementById('myframe'); | |
myframe.src = 'https://w3.org/about'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Merge Low 30bits and other high bits | |
//Reverse of https://gist.github.com/moorthy-g/bb3716303384365bce7b98b67af14fd1 | |
function mergeBits30(splitBits) { | |
let [highBits, lowBits] = splitBits; | |
return (highBits & 0x3fffff) * 0x40000000 + (lowBits & 0x3fffffff); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Javascript stores integer values in upto 52 bits binary | |
//But, it performs bitwise operations on 32 bits only | |
//This gist splits 30 lowbits & the other high bits(total of 52 bits) | |
//helpful for bitwise operations | |
function bitSplitAt30(n) { | |
if(n > 0x3fffffff) { | |
const lowBits = n & 0x3fffffff; | |
const highBits = (n-lowBits)/0x40000000; | |
return [highBits, lowBits]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Moorthy <moorthyrweb@gmail.com> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |