public final class HashSource extends ForwardSource
hash()来计算最终的哈希值| Modifier and Type | Method and Description |
|---|---|
ByteString |
hash() |
static HashSource |
hmacSha1(Source source,
ByteString key) |
static HashSource |
hmacSha256(Source source,
ByteString key) |
static HashSource |
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 HashSource |
sha1(Source source) |
static HashSource |
sha256(Source source) |
close, delegate, timeout, toStringpublic static HashSource md5(Source source)
public static HashSource sha1(Source source)
public static HashSource sha256(Source source)
public static HashSource hmacSha1(Source source, ByteString key)
public static HashSource 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 ForwardSourcesink - BufferbyteCount - longIOException - IOException IOException.public final ByteString hash()
Copyright © 2019. All rights reserved.