Example usage for com.google.common.hash Hashing hmacSha512

List of usage examples for com.google.common.hash Hashing hmacSha512

Introduction

In this page you can find the example usage for com.google.common.hash Hashing hmacSha512.

Prototype

public static HashFunction hmacSha512(byte[] key) 

Source Link

Document

Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the SHA-512 (512 hash bits) hash function and a SecretSpecKey created from the given byte array and the SHA-512 algorithm.

Usage

From source file:com.facebook.presto.operator.scalar.HmacFunctions.java

@Description("Compute HMAC with SHA512")
@ScalarFunction//from  w  w w.ja  v a2s . c o  m
@SqlType(StandardTypes.VARBINARY)
public static Slice hmacSha512(@SqlType(StandardTypes.VARBINARY) Slice slice,
        @SqlType(StandardTypes.VARBINARY) Slice key) {
    return wrappedBuffer(Hashing.hmacSha512(key.getBytes()).hashBytes(slice.getBytes()).asBytes());
}