public final class HashingSource extends ForwardingSource
hash()来计算最终的哈希值| Modifier and Type | Method and Description |
|---|---|
ByteString |
hash() |
static HashingSource |
hmacSha1(Source source,
ByteString key) |
static HashingSource |
hmacSha256(Source source,
ByteString key) |
static HashingSource |
md5(Source source) |
long |
read(Buffer sink,
long byteCount)
Removes at least 1, and up to
byteCount bytes from this and appends
them to sink. |
static HashingSource |
sha1(Source source) |
static HashingSource |
sha256(Source source) |
close, delegate, timeout, toStringpublic static HashingSource md5(Source source)
public static HashingSource sha1(Source source)
public static HashingSource sha256(Source source)
public static HashingSource hmacSha1(Source source, ByteString key)
public static HashingSource hmacSha256(Source source, ByteString key)
public long read(Buffer sink, long byteCount) throws IOException
SourcebyteCount bytes from this and appends
them to sink. Returns the number of bytes read, or -1 if this
source is exhausted.read in interface Sourceread in class ForwardingSourcesink - BufferbyteCount - longIOException - IOException IOException.public final ByteString hash()
Copyright © 2019. All rights reserved.