This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
function hexdump(buffer, blockSize) { | |
//determine the type of variable "buffer", and convert this to "string". | |
if(typeof buffer === 'string'){ | |
//console.log("buffer is string"); | |
//do nothing | |
}else if(buffer instanceof ArrayBuffer && buffer.byteLength !== undefined){ | |
//console.log("buffer is ArrayBuffer"); | |
buffer = String.fromCharCode.apply(String, [].slice.call(new Uint8Array(buffer))); | |
}else if(Array.isArray(buffer)){ | |
//console.log("buffer is Array"); |
// const entropy = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] | |
const entropy = []; | |
let captureStart = false; | |
/** | |
* Mouse Moving Entropy Generator on browser. | |
* Returns an entropy which is 16 bytes long array of unsigned char integer (0-255). | |
*/ | |
//$(document).on("mousemove", "html", function(e) { //JQuery (if JQuery was already included) | |
document.addEventListener('mousemove', function(e) { //Pure JavaScript. With this, this code working in console of browser, after "copy and paste" of this |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
;(function(){ | |
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ | |
/* SHA-256 implementation in JavaScript (c) Chris Veness 2002-2014 / MIT Licence */ | |
/* */ | |
/* - see http://csrc.nist.gov/groups/ST/toolkit/secure_hashing.html */ | |
/* http://csrc.nist.gov/groups/ST/toolkit/examples.html */ | |
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ | |
/* jshint node:true *//* global define, escape, unescape */ | |
'use strict'; |
Open this in new tab, and see console.log (F12 button); | |
<script> | |
//first 8336 hexadecimal digits of pi: https://gist.github.com/retrohacker/e5fff72b7b75ee058924 | |
//multiline string: | |
var pi_test_string = function(){/* | |
243F6A8885A308D313198A2E03707344A4093822299F31D0082EFA98EC4E6C89 | |
452821E638D01377BE5466CF34E90C6CC0AC29B7C97C50DD3F84D5B5B5470917 | |
9216D5D98979FB1BD1310BA698DFB5AC2FFD72DBD01ADFB7B8E1AFED6A267E96 | |
BA7C9045F12C7F9924A19947B3916CF70801F2E2858EFC16636920D871574E69 |