Skip to content

Instantly share code, notes, and snippets.

@ahmetgeymen
ahmetgeymen / index.html
Created December 28, 2020 00:18
OAuth Authorization Code + PKCE in Vanilla JS
<html>
<title>OAuth Authorization Code + PKCE in Vanilla JS</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--
MIT License
Copyright (c) 2019 Aaron Parecki
Permission is hereby granted, free of charge, to any person obtaining a copy
@chris-rock
chris-rock / crypto-buffer.js
Last active September 18, 2024 15:00
Encrypt and decrypt buffers in nodejs
// Part of https://github.com/chris-rock/node-crypto-examples
var crypto = require('crypto'),
algorithm = 'aes-256-ctr',
password = 'd6F3Efeq';
function encrypt(buffer){
var cipher = crypto.createCipher(algorithm,password)
var crypted = Buffer.concat([cipher.update(buffer),cipher.final()]);
return crypted;