Home Reference Source Test
import CryptoApi from 'crypto-api/src/crypto-api.mjs'
public class | source

CryptoApi

Main class for ES5 compatibility. Please use subclasses of Hasher for ES6

Member Summary

Public Members
public

encoder: {}

Method Summary

Public Methods
public

getHasher(name: string, options: Object): Hasher

Get hasher by alias

public

getHmac(key: string, hasher: Hasher): Hmac

Get HMAC instance

public

hash(name: string, message: string, options: Object): string

Hash UTF message and return result in hex

public

hmac(key: string, message: string, hasher: Hasher): string

HMAC with UTF key from UTF message and return result in hex

Public Members

public encoder: {} source

Public Methods

public getHasher(name: string, options: Object): Hasher source

Get hasher by alias

Params:

NameTypeAttributeDescription
name string
options Object

Return:

Hasher

public getHmac(key: string, hasher: Hasher): Hmac source

Get HMAC instance

Params:

NameTypeAttributeDescription
key string
hasher Hasher

Return:

Hmac

public hash(name: string, message: string, options: Object): string source

Hash UTF message and return result in hex

Params:

NameTypeAttributeDescription
name string
message string
options Object

Return:

string

public hmac(key: string, message: string, hasher: Hasher): string source

HMAC with UTF key from UTF message and return result in hex

Params:

NameTypeAttributeDescription
key string
message string
hasher Hasher

Return:

string