Skip to content

Instantly share code, notes, and snippets.

View SoftCreatR's full-sized avatar
👻
Boo!

Sascha Greuel SoftCreatR

👻
Boo!
View GitHub Profile
@SoftCreatR
SoftCreatR / hashBrowser.js
Created June 5, 2019 09:36
Creates a hash for a value using the SHA-256 algorithm. Returns a promise. Use the SubtleCrypto API to create a hash for the given value.
const hashBrowser = val =>
crypto.subtle.digest('SHA-256', new TextEncoder('utf-8').encode(val)).then(h => {
let hexes = [],
view = new DataView(h);
for (let i = 0; i < view.byteLength; i += 4)
hexes.push(('00000000' + view.getUint32(i).toString(16)).slice(-8));
return hexes.join('');
});
hashBrowser(JSON.stringify({ a: 'a', b: [1, 2, 3, 4], foo: { c: 'bar' } })).then(console.log);
@SoftCreatR
SoftCreatR / README.md
Last active April 25, 2021 11:24
ImageMagick® 7 for Debian/Ubuntu.

Keybase proof

I hereby claim:

  • I am softcreatr on github.
  • I am softcreatr (https://keybase.io/softcreatr) on keybase.
  • I have a public key ASBeCREGTrqjYfuasx33kBiM979-wX0rOPy9Ezd5-Q_n6Qo

To claim this, I am signing this object:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.