All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aQute.libg.cryptography.SHA1 Maven / Gradle / Ivy

There is a newer version: 2.0.0.20130123-133441
Show newest version
package aQute.libg.cryptography;

import java.security.*;



public class SHA1 extends Digest {
	public final static String ALGORITHM = "SHA1";
	
	public static Digester getDigester() throws NoSuchAlgorithmException {
		MessageDigest md = MessageDigest.getInstance(ALGORITHM);
		return new Digester(md) {
			@Override public SHA1 digest() throws Exception {
				return new SHA1(md.digest());
			}

			@Override public SHA1 digest(byte[] bytes) {
				return new SHA1(bytes);
			}
			@Override public String getAlgorithm() {
				return ALGORITHM;
			}
		};
	}
	
	public SHA1(byte[] b) {
		super(b, 20);
	}


	@Override public String getAlgorithm() { return ALGORITHM; }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy