Skip to content

Instantly share code, notes, and snippets.

@7c
7c / sha512.js
Created Nov 29, 2018
Browser implementation of sha512
View sha512.js
function hex(buffer) {
var hexCodes = [];
var view = new DataView(buffer);
for (var i = 0; i < view.byteLength; i += 4) {
// Using getUint32 reduces the number of iterations needed (we process 4 bytes each time)
var value = view.getUint32(i)
// toString(16) will give the hex representation of the number without padding
var stringValue = value.toString(16)
// We use concatenation and slice for padding
var padding = '00000000'
@7c
7c / .gitignore
Created Dec 12, 2017 — forked from iffy/.gitignore
Example using electron-updater with `generic` provider.
View .gitignore
node_modules
dist/
yarn.lock
wwwroot