Code example for MessageDigest

Methods: digest, update

0
			} 
		} 
	} 
 
	public File getCacheFile(String key) {
		this.mHash.update(key.getBytes());
		byte[] digest = this.mHash.digest();
		BigInteger digestBigInteger = new BigInteger(1, digest);
		String hash = digestBigInteger.toString(16);
 
		return new File(this.mBaseDirectory, hash + this.mPostfix);
	} 
 
	public long getFileSize(File file) {
		if (Build.VERSION.SDK_INT > 9) {
			return this.getFileSize9(file);
		} 
		StatFs statFs = new StatFs(file.getAbsolutePath());
		int blockSize = statFs.getBlockSize();
		int blockCount = statFs.getBlockCount();
		return (long) blockCount * (long) blockSize;