Skip to content

Instantly share code, notes, and snippets.

View Porama6400's full-sized avatar
💭
I might be a back-end developer, who knows?

Porama6400 Porama6400

💭
I might be a back-end developer, who knows?
View GitHub Profile

Keybase proof

I hereby claim:

  • I am porama6400 on github.
  • I am porama6400 (https://keybase.io/porama6400) on keybase.
  • I have a public key whose fingerprint is E4F4 5B3D 263C E4B9 8819 8738 ABCA 1CA9 2E1E 410C

To claim this, I am signing this object:

@Porama6400
Porama6400 / Checksum.java
Created January 12, 2018 03:06
A method to checksum a file
public static String checksum(File file) throws IOException, NoSuchAlgorithmException {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
byte[] buff = new byte[bis.available()];
bis.read(buff, 0, buff.length);
byte[] hash = digest.digest(buff);
return new BASE64Encoder().encode(hash);
}
@Porama6400
Porama6400 / EasyAES.java
Created April 30, 2016 15:34
Make your life easier with AES Encryption :) by Porama6400
package me.Porama6400.SOMEWHERE;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
/**
* Created by Porama6400 on 30/4/2016.
*/
public class EasyAES {
byte[] key;