Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cascalheira's full-sized avatar

António Cascalheira cascalheira

  • Arcos de Valdevez
View GitHub Profile
@cascalheira
cascalheira / HMAC.java
Created September 2, 2020 16:03 — forked from MaximeFrancoeur/HMAC.java
Generating HMAC MD5/SHA1/SHA256 etc in Java
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
public class HMAC {
public static void main(String[] args) throws Exception {
System.out.println(hmacDigest("The quick brown fox jumps over the lazy dog", "key", "HmacSHA1"));
}
import Ember from 'ember';
import DS from 'ember-data';
/**
* Returns true iff the number passed in is even
* @param {Number} x
* @return {Boolean}
*/
function isEven(x) {
return x % 2 == 0;