Skip to content

Instantly share code, notes, and snippets.

View DUANISTON's full-sized avatar

Duaniston Silva DUANISTON

View GitHub Profile
@DUANISTON
DUANISTON / crypto-pbkdf2.js
Created February 15, 2022 18:53 — forked from chrisveness/crypto-pbkdf2.js
Uses the SubtleCrypto interface of the Web Cryptography API to hash a password using PBKDF2, and validate a stored password hash against a subsequently supplied password. Note that both bcrypt and scrypt offer better defence against ASIC/GPU attacks, but are not available within WebCrypto.
/**
* Returns PBKDF2 derived key from supplied password.
*
* Stored key can subsequently be used to verify that a password matches the original password used
* to derive the key, using pbkdf2Verify().
*
* @param {String} password - Password to be hashed using key derivation function.
* @param {Number} [iterations=1e6] - Number of iterations of HMAC function to apply.
* @returns {String} Derived key as base64 string.
*
@DUANISTON
DUANISTON / funcaoJavaScriptPhp.php
Created June 9, 2020 12:44 — forked from antonio-abrantes/funcaoJavaScriptPhp.php
Executar função PHP através de função JavaScript
<!DOCTYPE html>
<!--
Exemplo de como executar uma função PHP disparada por um botão simples através de JavaScript.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
#formulario{